Class AnimatedBox2DSprite

java.lang.Object
com.badlogic.gdx.graphics.g2d.TextureRegion
com.badlogic.gdx.graphics.g2d.Sprite
net.dermetfan.gdx.graphics.g2d.Box2DSprite
net.dermetfan.gdx.graphics.g2d.AnimatedBox2DSprite

public class AnimatedBox2DSprite
extends Box2DSprite
A Box2DSprite using an AnimatedSprite for animation.
  • Constructor Details

    • AnimatedBox2DSprite

      public AnimatedBox2DSprite​(net.dermetfan.gdx.graphics.g2d.AnimatedSprite animatedSprite)
      creates a new AnimatedBox2DSprite with the given AnimatedSprite
      Parameters:
      animatedSprite - the AnimatedSprite to use
  • Method Details

    • draw

      public void draw​(com.badlogic.gdx.graphics.g2d.Batch batch, float box2dX, float box2dY, float box2dWidth, float box2dHeight, float box2dRotation)
      updates before drawing if isAutoUpdate() is true
      Overrides:
      draw in class Box2DSprite
      box2dX - the x coordinate (center) of the body or fixture
      box2dY - the y coordinate (center) of the body or fixture
      box2dWidth - the width of the body or fixture
      box2dHeight - the height of the body or fixture
      box2dRotation - the rotation of the body or fixture
    • update

      public void update()
      updates with Graphics.getDeltaTime()
      See Also:
      update(float)
    • update

      public void update​(float delta)
      Parameters:
      delta - the delta time to update with
    • getAnimatedSprite

      public net.dermetfan.gdx.graphics.g2d.AnimatedSprite getAnimatedSprite()
      Returns:
      the AnimatedSprite
    • setAnimatedSprite

      public void setAnimatedSprite​(net.dermetfan.gdx.graphics.g2d.AnimatedSprite animatedSprite)
      Parameters:
      animatedSprite - the AnimatedSprite to set
    • getAnimation

      public com.badlogic.gdx.graphics.g2d.Animation getAnimation()
      See Also:
      AnimatedSprite.getAnimation()
    • setAnimation

      public void setAnimation​(com.badlogic.gdx.graphics.g2d.Animation animation)
      See Also:
      AnimatedSprite.setAnimation(Animation)
    • isUseFrameRegionSize

      public boolean isUseFrameRegionSize()
      See Also:
      AnimatedSprite.isUseFrameRegionSize()
    • setUseFrameRegionSize

      public void setUseFrameRegionSize​(boolean useFrameRegionSize)
      See Also:
      AnimatedSprite.setUseFrameRegionSize(boolean)
    • flipFrames

      public void flipFrames​(float startTime, float endTime, boolean flipX, boolean flipY, boolean set)
      See Also:
      AnimatedSprite.flipFrames(float, float, boolean, boolean, boolean)
    • isAnimationFinished

      public boolean isAnimationFinished()
      See Also:
      AnimatedSprite.isAnimationFinished()
    • stop

      public void stop()
      See Also:
      AnimatedSprite.stop()
    • isAutoUpdate

      public boolean isAutoUpdate()
      See Also:
      AnimatedSprite.isAutoUpdate()
    • setAutoUpdate

      public void setAutoUpdate​(boolean autoUpdate)
      See Also:
      AnimatedSprite.setAutoUpdate(boolean)
    • flipFrames

      public void flipFrames​(boolean flipX, boolean flipY)
      See Also:
      AnimatedSprite.flipFrames(boolean, boolean)
    • isCenterFrames

      public boolean isCenterFrames()
      See Also:
      AnimatedSprite.isCenterFrames()
    • setCenterFrames

      public void setCenterFrames​(boolean centerFrames)
      See Also:
      AnimatedSprite.setCenterFrames(boolean)
    • flipFrames

      public void flipFrames​(float startTime, float endTime, boolean flipX, boolean flipY)
      See Also:
      AnimatedSprite.flipFrames(float, float, boolean, boolean)
    • play

      public void play()
      See Also:
      AnimatedSprite.play()
    • getTime

      public float getTime()
      See Also:
      AnimatedSprite.getTime()
    • setTime

      public void setTime​(float time)
      See Also:
      AnimatedSprite.setTime(float)
    • flipFrames

      public void flipFrames​(boolean flipX, boolean flipY, boolean set)
      See Also:
      AnimatedSprite.flipFrames(boolean, boolean, boolean)
    • pause

      public void pause()
      See Also:
      AnimatedSprite.pause()
    • isPlaying

      public boolean isPlaying()
      See Also:
      AnimatedSprite.isPlaying()
    • setPlaying

      public void setPlaying​(boolean playing)
      See Also:
      AnimatedSprite.setPlaying(boolean)