Package net.dermetfan.gdx.graphics.g2d
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.-
Field Summary
Fields inherited from class net.dermetfan.gdx.graphics.g2d.Box2DSprite
defaultUserDataAccessor -
Constructor Summary
Constructors Constructor Description AnimatedBox2DSprite(net.dermetfan.gdx.graphics.g2d.AnimatedSprite animatedSprite)creates a newAnimatedBox2DSpritewith the givenAnimatedSprite -
Method Summary
Modifier and Type Method Description voiddraw(com.badlogic.gdx.graphics.g2d.Batch batch, float box2dX, float box2dY, float box2dWidth, float box2dHeight, float box2dRotation)updatesbefore drawing ifisAutoUpdate()is truevoidflipFrames(boolean flipX, boolean flipY)voidflipFrames(boolean flipX, boolean flipY, boolean set)voidflipFrames(float startTime, float endTime, boolean flipX, boolean flipY)voidflipFrames(float startTime, float endTime, boolean flipX, boolean flipY, boolean set)net.dermetfan.gdx.graphics.g2d.AnimatedSpritegetAnimatedSprite()com.badlogic.gdx.graphics.g2d.AnimationgetAnimation()floatgetTime()booleanisAnimationFinished()booleanisAutoUpdate()booleanisCenterFrames()booleanisPlaying()booleanisUseFrameRegionSize()voidpause()voidplay()voidsetAnimatedSprite(net.dermetfan.gdx.graphics.g2d.AnimatedSprite animatedSprite)voidsetAnimation(com.badlogic.gdx.graphics.g2d.Animation animation)voidsetAutoUpdate(boolean autoUpdate)voidsetCenterFrames(boolean centerFrames)voidsetPlaying(boolean playing)voidsetTime(float time)voidsetUseFrameRegionSize(boolean useFrameRegionSize)voidstop()voidupdate()updates withGraphics.getDeltaTime()voidupdate(float delta)Methods inherited from class net.dermetfan.gdx.graphics.g2d.Box2DSprite
draw, draw, draw, draw, getUserDataAccessor, getZComparator, getZIndex, isAdjustHeight, isAdjustWidth, isUseOriginX, isUseOriginY, setAdjustHeight, setAdjustSize, setAdjustWidth, setHeight, setUseOrigin, setUseOriginX, setUseOriginY, setUserDataAccessor, setWidth, setZComparator, setZIndexMethods inherited from class com.badlogic.gdx.graphics.g2d.Sprite
draw, draw, flip, getBoundingRectangle, getColor, getHeight, getOriginX, getOriginY, getRotation, getScaleX, getScaleY, getVertices, getWidth, getX, getY, rotate, rotate90, scale, scroll, set, setAlpha, setBounds, setCenter, setCenterX, setCenterY, setColor, setColor, setFlip, setOrigin, setOriginBasedPosition, setOriginCenter, setPackedColor, setPosition, setRegion, setRotation, setScale, setScale, setSize, setU, setU2, setV, setV2, setX, setY, translate, translateX, translateYMethods inherited from class com.badlogic.gdx.graphics.g2d.TextureRegion
getRegionHeight, getRegionWidth, getRegionX, getRegionY, getTexture, getU, getU2, getV, getV2, isFlipX, isFlipY, setRegion, setRegion, setRegion, setRegion, setRegionHeight, setRegionWidth, setRegionX, setRegionY, setTexture, split, splitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AnimatedBox2DSprite
public AnimatedBox2DSprite(net.dermetfan.gdx.graphics.g2d.AnimatedSprite animatedSprite)creates a newAnimatedBox2DSpritewith the givenAnimatedSprite- Parameters:
animatedSprite- theAnimatedSpriteto use
-
-
Method Details
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float box2dX, float box2dY, float box2dWidth, float box2dHeight, float box2dRotation)updatesbefore drawing ifisAutoUpdate()is true- Overrides:
drawin classBox2DSpritebox2dX- the x coordinate (center) of the body or fixturebox2dY- the y coordinate (center) of the body or fixturebox2dWidth- the width of the body or fixturebox2dHeight- the height of the body or fixturebox2dRotation- the rotation of the body or fixture
-
update
public void update()updates withGraphics.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- theAnimatedSpriteto 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)
-