Package com.csse3200.game.rendering
Class AnimationRenderWithAudioComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.rendering.AnimationRenderComponent
com.csse3200.game.rendering.AnimationRenderWithAudioComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
-
Field Summary
Fields inherited from class com.csse3200.game.rendering.AnimationRenderComponent
animationPlayTime, currentAnimation, currentAnimationName
-
Constructor Summary
ConstructorsConstructorDescriptionAnimationRenderWithAudioComponent
(com.badlogic.gdx.graphics.g2d.TextureAtlas atlas) Create the component for a given texture atlas. -
Method Summary
Methods inherited from class com.csse3200.game.rendering.AnimationRenderComponent
addAnimation, addAnimation, dispose, getAtlas, getCurrentAnimation, getFlipX, getFlipY, hasAnimation, isFinished, removeAnimation, scaleEntity, setFlipX, setFlipY, stopAnimation
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, create, getLayer, getZIndex, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
AnimationRenderWithAudioComponent
public AnimationRenderWithAudioComponent(com.badlogic.gdx.graphics.g2d.TextureAtlas atlas) Create the component for a given texture atlas.- Parameters:
atlas
- libGDX-supported texture atlas containing desired animations
-
-
Method Details
-
addSound
-
startAnimation
Start playback of an animation. The animation must have been added using addAnimation().- Overrides:
startAnimation
in classAnimationRenderComponent
- Parameters:
name
- Name of the animation to play.
-
draw
protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Description copied from class:RenderComponent
Draw the renderable. Should be called only by the renderer, not manually.- Overrides:
draw
in classAnimationRenderComponent
- Parameters:
batch
- Batch to render to.
-