Class EntityEmitter
java.lang.Object
de.gurkenlabs.litiengine.entities.Entity
de.gurkenlabs.litiengine.graphics.emitters.Emitter
de.gurkenlabs.litiengine.graphics.emitters.EntityEmitter
- All Implemented Interfaces:
EntityRenderedListener,EntityRenderListener,IEntity,IRenderable,ITimeToLive,IUpdateable,Tweenable,EventListener
A standard implementation for emitters that are bound to
IEntity.getLocation().- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.gurkenlabs.litiengine.graphics.emitters.Emitter
Emitter.EmitterFinishedListener -
Field Summary
Fields inherited from class de.gurkenlabs.litiengine.entities.Entity
ANY_MESSAGE -
Constructor Summary
ConstructorsConstructorDescriptionEntityEmitter(IEntity entity) Instantiates a new entity emitter that remains at the location where it has been created.EntityEmitter(IEntity entity, boolean dynamicLocation) Instantiates a new entity emitter.EntityEmitter(IEntity entity, EmitterData emitterData) Constructs a new EntityEmitter with EmitterData that remains at the location where it has been created.EntityEmitter(IEntity entity, EmitterData emitterData, boolean dynamicLocation) Constructs a new EntityEmitter with EmitterData that follows an entity's location.EntityEmitter(IEntity entity, String emitterResourceName) Constructs a new EntityEmitter from a given emitter resource that remains at the location where it has been created.EntityEmitter(IEntity entity, String emitterResourceName, boolean dynamicLocation) Constructs a new EntityEmitter from a given emitter resource that follows an entity's location. -
Method Summary
Modifier and TypeMethodDescriptionGet the IEntity to which this emitter is bound.doubleGets the height of the entity.Gets the location of the entity.doublegetWidth()Gets the width of the entity.doublegetX()Gets the X coordinate of the entity.doublegetY()Gets the Y coordinate of the entity.booleanCheck if the emitter has dynamic location tracking enabled.voidsetDynamicLocation(boolean dynamicLocation) Toggle dynamic location updates.Methods inherited from class de.gurkenlabs.litiengine.graphics.emitters.Emitter
activate, addParticle, canTakeNewParticles, createNewParticle, data, deactivate, delete, getAliveTime, getOrigin, getParticles, getRenderable, getTimeToLive, isActivated, isActivateOnInit, isFinished, isPaused, isStopped, onFinished, particleCanBeRemoved, removeFinishedListener, render, setEmitterData, setEmitterData, setPaused, setStopped, spawnParticle, timeToLiveReached, togglePaused, toggleStopped, update, updateOriginMethods inherited from class de.gurkenlabs.litiengine.entities.Entity
actions, addController, addEntityRenderListener, addListener, addTag, addTransformListener, animations, attachControllers, behavior, canRender, detachControllers, getAngle, getBoundingBox, getCenter, getController, getControllers, getEnvironment, getMapId, getName, getProperties, getRenderType, getTags, getTweenValues, hasTag, isLoaded, isVisible, loaded, onMessage, onMessage, onRendered, perform, register, removed, removeListener, removeListener, removeListener, removeListener, removeListener, removeTag, rendered, rendering, renderWithLayer, sendMessage, setAngle, setController, setHeight, setLocation, setLocation, setMapId, setName, setRenderType, setRenderWithLayer, setSize, setTweenValues, setVisible, setWidth, setX, setY, toString
-
Constructor Details
-
EntityEmitter
Constructs a new EntityEmitter from a given emitter resource that follows an entity's location.- Parameters:
entity- The IEntity to which this emitter is bound.emitterResourceName- The name of the configuration for this emitter. If the Emitter has been added to the game resource file, it is loaded from there by name. Otherwise, the EmitterLoader will search the Resource folders for a file with the emitterResourceName.dynamicLocation- If true, the emitter follows the entity's location; if false, it remains at the location where it has been created.
-
EntityEmitter
Constructs a new EntityEmitter from a given emitter resource that remains at the location where it has been created.- Parameters:
entity- The IEntity to which this emitter is bound.emitterResourceName- The name of the configuration for this emitter. If the Emitter has been added to the game resource file, it is loaded from there by name. Otherwise, the EmitterLoader will search the Resource folders for a file with the emitterResourceName.
-
EntityEmitter
Constructs a new EntityEmitter with EmitterData that follows an entity's location.- Parameters:
entity- The IEntity to which this emitter is bound.emitterData- The EmitterData object defining the emitter's behavior.dynamicLocation- If true, the emitter follows the entity's location; if false, it remains at the location where it has been created.
-
EntityEmitter
Constructs a new EntityEmitter with EmitterData that remains at the location where it has been created.- Parameters:
entity- The IEntity to which this emitter is bound.emitterData- The EmitterData object defining the emitter's behavior.
-
EntityEmitter
Instantiates a new entity emitter that remains at the location where it has been created.- Parameters:
entity- The IEntity to which this emitter is bound.
-
EntityEmitter
Instantiates a new entity emitter.- Parameters:
entity- The IEntity to which this emitter is bound.dynamicLocation- If true, the emitter follows the entity's location; if false, it remains at the location where it has been created.
-
-
Method Details
-
getEntity
Get the IEntity to which this emitter is bound.- Returns:
- The IEntity to which this emitter is bound.
-
hasDynamicLocation
public boolean hasDynamicLocation()Check if the emitter has dynamic location tracking enabled. This determines whether this Emitter's location is updated along its entity's location.- Returns:
- True if dynamic location is enabled, false otherwise.
-
setDynamicLocation
public void setDynamicLocation(boolean dynamicLocation) Toggle dynamic location updates.- Parameters:
dynamicLocation- If true, the emitter follows its entity's location; if false, it remains at the location where it has been created.
-
getWidth
-
getHeight
-
getX
-
getY
-
getLocation
Description copied from interface:IEntityGets the location of the entity.- Specified by:
getLocationin interfaceIEntity- Overrides:
getLocationin classEntity- Returns:
- The location of the entity.
-