//------------------------------------------------------------------------- public void update(float elapsed_tm) { if (mIsNeedAutoDestroy) { mTimeCounter += elapsed_tm; if (mTimeCounter >= mFunDelayTime) { remove(this); } else if (mNeedFadeout) { mAlpha -= elapsed_tm / mFadeoutFunDelayTime; mCSpriteNumber.setAlpha(mAlpha); } else { mMassEntity.update(elapsed_tm); mCSpriteNumber.setPosition(mMassEntity.Position, 0); if (mMassEntity.IsEndRoute) { mNeedFadeout = true; } } } }
//--------------------------------------------------------------------- void updateRotate(float elapsed_tm) { if (mRoteteRight) { mCurrentAngle += mRotateSpeed * elapsed_tm; if (mCurrentAngle >= mMaxAngle) { mCurrentAngle = mMaxAngle; mRoteteRight = !mRoteteRight; } } else { mCurrentAngle -= mRotateSpeed * elapsed_tm; if (mCurrentAngle <= -mMaxAngle) { mCurrentAngle = -mMaxAngle; mRoteteRight = !mRoteteRight; } } mSpriteNumber.setPosition(mPosition, mAngle + mCurrentAngle); }
//------------------------------------------------------------------------- public void setPosition(EbVector3 position, float angle) { mCSpriteNumber.setPosition(position, angle); mNumberBackgroundCSprite.setPosition(position); mNumberBackgroundCSprite.setDirection(angle); }
//------------------------------------------------------------------------- public void setDigitPosition(EbVector3 position, float up_angle) { mSpriteNumber.setPosition(position, up_angle); }