Package com.csse3200.game.components
Class ParticleComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.components.ParticleComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,Renderable,Comparable<Renderable>
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionParticleComponent(ParticleEffectsConfig effectsConfig) Creates a new EffectComponent using the effects specified in the effectsConfig. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Loads the effects specified in the config file into a hashmap for later use.protected voiddraw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw the renderable.voidstartEffect(String effectName) Plays the effect which effectName maps to if it exists.voidstopEffect(String effectName) Stops the playing of the effect which effectName maps to if it exists.Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, dispose, getLayer, getZIndex, overrideZIndex, renderMethods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
ParticleComponent
Creates a new EffectComponent using the effects specified in the effectsConfig.- Parameters:
effectsConfig- - the config file containing the effects which can be played.
-
-
Method Details
-
create
public void create()Loads the effects specified in the config file into a hashmap for later use.- Overrides:
createin classRenderComponent
-
draw
protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Description copied from class:RenderComponentDraw the renderable. Should be called only by the renderer, not manually.- Specified by:
drawin classRenderComponent- Parameters:
batch- Batch to render to.
-
startEffect
Plays the effect which effectName maps to if it exists. If effectName does not map to a loaded effect, nothing happens.- Parameters:
effectName- - the name of the effect to play as specified in the config file.
-
stopEffect
Stops the playing of the effect which effectName maps to if it exists. If effectName does not map to a loaded effect, nothing happens.- Parameters:
effectName- - the name of the effect to stop as specified in the config file.
-