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 newAnimatedBox2DSprite
with the givenAnimatedSprite
-
Method Summary
Modifier and Type Method Description void
draw(com.badlogic.gdx.graphics.g2d.Batch batch, float box2dX, float box2dY, float box2dWidth, float box2dHeight, float box2dRotation)
updates
before drawing ifisAutoUpdate()
is truevoid
flipFrames(boolean flipX, boolean flipY)
void
flipFrames(boolean flipX, boolean flipY, boolean set)
void
flipFrames(float startTime, float endTime, boolean flipX, boolean flipY)
void
flipFrames(float startTime, float endTime, boolean flipX, boolean flipY, boolean set)
net.dermetfan.gdx.graphics.g2d.AnimatedSprite
getAnimatedSprite()
com.badlogic.gdx.graphics.g2d.Animation
getAnimation()
float
getTime()
boolean
isAnimationFinished()
boolean
isAutoUpdate()
boolean
isCenterFrames()
boolean
isPlaying()
boolean
isUseFrameRegionSize()
void
pause()
void
play()
void
setAnimatedSprite(net.dermetfan.gdx.graphics.g2d.AnimatedSprite animatedSprite)
void
setAnimation(com.badlogic.gdx.graphics.g2d.Animation animation)
void
setAutoUpdate(boolean autoUpdate)
void
setCenterFrames(boolean centerFrames)
void
setPlaying(boolean playing)
void
setTime(float time)
void
setUseFrameRegionSize(boolean useFrameRegionSize)
void
stop()
void
update()
updates withGraphics.getDeltaTime()
void
update(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, setZIndex
Methods 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, translateY
Methods 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, split
Methods 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 newAnimatedBox2DSprite
with the givenAnimatedSprite
- Parameters:
animatedSprite
- theAnimatedSprite
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 ifisAutoUpdate()
is true- Overrides:
draw
in classBox2DSprite
box2dX
- 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
- theAnimatedSprite
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)
-