Ejemplo n.º 1
0
bool 
LauncherScene::enterEditMode()
{
	Block::setFocusVisible(false);
	rememberBlocksRawPos_EM();
#if _LAUNCHER_EDITMENU_OLDSTYLE_
	showEditMenu_Four();
#endif //_LAUNCHER_EDITMENU_OLDSTYLE_
	for (int i = 0;i<__MAX_BLOCK_NUM;i++)
	{
		m_ppBlocklist[i]->setMaskVisible(true);
	}
	setTimePosition(_LAUNCHER_EDIT_ENTER_START_,_LAUNCHER_EDIT_ENTER_END_);
	m_pBldAnm->play();
	m_pEditPageAnm->play();
	m_pExitEMAnm->play();

	for (int i = 0;i<__MAX_BLOCK_NUM;i++)
	{
		m_ppBlocklist[i]->playAnimation();
	}
	setTvBlockEnable(false);

	nextEditBlockBldAni = Enter_Ani;

	initEditBlock();

	return true;
}
Ejemplo n.º 2
0
void 
Menu::showMenu()
{
	setTimePosition(_SHOW_ANM_START_,_SHOW_ANM_END_);
	for (int i = 0;i<_MENU_NODE_ANMNUM_;i++)
	{
		m_ppBldAnm[i]->play();
	}
}
Ejemplo n.º 3
0
void 
Menu::hideMenu()
{
	setTimePosition(_HIDE_ANM_START_,_HIDE_ANM_END_);
	for (int i = 0;i<_MENU_NODE_ANMNUM_;i++)
	{
		m_ppBldAnm[i]->play();
	}
	RootView::setFocusVisible(false);
}
Ejemplo n.º 4
0
bool 
LauncherScene::exitEditMode()
{
	Block::setFocusVisible(true);
	setTimePosition(_LAUNCHER_EDIT_EXIT_START_,_LAUNCHER_EDIT_EXIT_END_);
	m_pBldAnm->setFrameScope(_LAUNCHER_EDIT_ROOTEXIT_START_,_LAUNCHER_EDIT_ROOTEXIT_END_);
	setTvBlockEnable(true);
#if _LAUNCHER_EDITMENU_OLDSTYLE_
	hideEditMenu_Four();
#else
	for (int i = 0;i<__MAX_BLOCK_NUM;i++)
	{
		m_ppBlocklist[i]->setMaskVisible(false);
	}
	//getBlockByID(getCurrentBlockID())->hideMenu();
#endif //_LAUNCHER_EDITMENU_OLDSTYLE_
	
	m_pBldAnm->play();
	m_pEditPageAnm->play();
	m_pExitEMAnm->play();
	for (int i = 0;i<__MAX_BLOCK_NUM;i++)
	{
		m_ppBlocklist[i]->playAnimation();
	}
	
	//退出edit后,把focus放到初始位置
	exitEditFocus();

	nextEditBlockBldAni= Quit_Ani;

	m_pTitleBlock->setTitleBlockVisable(true);

	for (int i = 0; i < __MAX_BLOCK_NUM; i++)
	{
		if (m_ppBlocklist[i]->getAddBlockSymbol())
		{
			m_ppBlocklist[i]->getAddBlockSymbol()->setVisible(true);
			break;
		}
	}
	hasEnterEditAniFinished = false;
	hasFinishEditSBA = true;
	return true;
}
Ejemplo n.º 5
0
  void Animation::update(double time)
  {
    if(!isInitialized() || !mAnimationState->getEnabled())
      return;

    float len = getLength();
    mAnimationState->addTime(time * mSpeed);

    // TODO: Add ability to customize fade out speed
    if(!getLoop())
    {
      double delta = len * 0.1f;
      if(mSpeed > 0 && getTimePosition() > (len - delta))
        disable();
      else if(mSpeed < 0 && getTimePosition() < delta)
        disable();
    }

    if(mFadeIn)
    {
      float newWeight = mAnimationState->getWeight() + time * mFadeTime;
      mAnimationState->setWeight(Ogre::Math::Clamp<float>(newWeight, 0, 1));
      if(newWeight >= 1)
        mFadeIn = false;
    }
    else if(mFadeOut)
    {
      float newWeight = mAnimationState->getWeight() - time * mFadeTime;
      mAnimationState->setWeight(Ogre::Math::Clamp<float>(newWeight, 0, 1));
      if(newWeight <= 0)
      {
        mFadeOut = false;
        mAnimationState->setEnabled(false);
        setTimePosition(getLength());
      }
    }
  }
Ejemplo n.º 6
0
 void Animation::rewind(double offset)
 {
   setTimePosition(mSpeed > 0 ? offset : getLength() - offset);
 }
 //---------------------------------------------------------------------
 void AnimationState::addTime(Real offset)
 {
     setTimePosition(mTimePos + offset);
 }