Example #1
0
 public void reset() {
   mCurrentTime = 0;
   mFrameIndex = -1;
   mKeyFrameIndex = 0;
   if (mKeyFrames.size() > 1) {
     mNextKeyFrameTime = mKeyFrames.get(1).mTime;
   }
   mPosX = mStartX - (mFrameWidth / 2);
   mPosY = mStartY - (mFrameHeight / 2);
   mAnimationSprite.setPosition(mPosX, mPosY);
 }
Example #2
0
  public TiledSprite loadAnimation() {
    mEngine = RoguelikeActivity.getContext().getEngine();

    Graphics.beginLoad("gfx/", TEXTURE_ATLAS_WIDTH, TEXTURE_ATLAS_HEIGHT);
    mAnimationSprite =
        Graphics.createTiledSprite(mAnimationName, mFramesX, mFramesY, mStartX, mStartY);
    Graphics.endLoad("Animation " + mAnimationName);

    mAnimationSprite.setRotation(mRotatation);
    mAnimationSprite.setFlippedHorizontal(isFlippedHorizontal());
    mAnimationSprite.setFlippedVertical(isFlippedVertical());
    mAnimationSprite.setPosition(mPosX, mPosY);

    return mAnimationSprite;
  }