Class Spawnpoint
java.lang.Object
de.gurkenlabs.litiengine.entities.Entity
de.gurkenlabs.litiengine.entities.Spawnpoint
- All Implemented Interfaces:
EntityRenderedListener,EntityRenderListener,IEntity,Tweenable,EventListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface for listening to entity spawned events. -
Field Summary
Fields inherited from class de.gurkenlabs.litiengine.entities.Entity
ANY_MESSAGE -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a newSpawnpointentity.Spawnpoint(double x, double y) Instantiates a newSpawnpointentity.Spawnpoint(double x, double y, Direction direction) Spawnpoint(int mapId, double x, double y) Instantiates a newSpawnpointentity.Spawnpoint(int mapId, double x, double y, Direction direction) Instantiates a newSpawnpointentity.Spawnpoint(int mapId, Point2D location) Instantiates a newSpawnpointentity.Spawnpoint(int mapId, Point2D location, Direction direction) Instantiates a newSpawnpointentity.Spawnpoint(Direction direction) Instantiates a newSpawnpointentity.Spawnpoint(Direction direction, String spawnType) Instantiates a newSpawnpointentity.Spawnpoint(Point2D location) Spawnpoint(Point2D location, Direction direction) -
Method Summary
Modifier and TypeMethodDescriptionGets the direction in which entities will be spawned by this instance.Gets the spawn information for this instance.doubleGets the spawn offset on the X-axis for this instance.doubleGets the spawn offset on the Y-axis for this instance.Gets the spawn pivot type for this instance.voidonSpawned(Spawnpoint.EntitySpawnedListener listener) Adds the specified entity spawned listener to receive events when entities are spawned by this instance.voidRemoves the specified entity spawned listener.voidsetDirection(Direction direction) Sets the direction in which entities will be spawned by this instance.voidsetSpawnInfo(String spawnInfo) Sets the spawn information for this instance.voidsetSpawnOffsetX(double spawnOffsetX) Sets the spawn offset on the X-axis for this instance.voidsetSpawnOffsetY(double spawnOffsetY) Sets the spawn offset on the Y-axis for this instance.voidsetSpawnPivotType(EntityPivotType spawnPivotType) Sets the spawn pivot type for this instance.booleanSpawns the specified entity to theEnvironmentof theSpawnpointor the currently activeEnvironment.Methods 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, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getTweenValues, getWidth, getX, getY, 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
-
Spawnpoint
public Spawnpoint()Instantiates a newSpawnpointentity. -
Spawnpoint
public Spawnpoint(double x, double y) Instantiates a newSpawnpointentity.- Parameters:
x- The x-coordinate of this instance.y- The y-coordinate of this instance.
-
Spawnpoint
-
Spawnpoint
-
Spawnpoint
-
Spawnpoint
public Spawnpoint(int mapId, double x, double y) Instantiates a newSpawnpointentity.- Parameters:
mapId- The map id of this instance.x- The x-coordinate of this instance.y- The y-coordinate of this instance.
-
Spawnpoint
Instantiates a newSpawnpointentity.- Parameters:
mapId- The map id of this instance.location- The location of this instance.
-
Spawnpoint
Instantiates a newSpawnpointentity.- Parameters:
mapId- The map id of this instance.x- The x-coordinate of this instance.y- The y-coordinate of this instance.direction- The direction in which entities will be spawned by this instance.
-
Spawnpoint
Instantiates a newSpawnpointentity.- Parameters:
mapId- The map id of this instance.location- The location of this instance.direction- The direction in which entities will be spawned by this instance.
-
Spawnpoint
Instantiates a newSpawnpointentity.- Parameters:
direction- The direction in which entities will be spawned by this instance.
-
Spawnpoint
Instantiates a newSpawnpointentity.- Parameters:
direction- The direction in which entities will be spawned by this instance.spawnType- The type that defines additional information about the entities spawned by this instance.
-
-
Method Details
-
onSpawned
Adds the specified entity spawned listener to receive events when entities are spawned by this instance.- Parameters:
listener- The listener to add.
-
removeSpawnedListener
Removes the specified entity spawned listener.- Parameters:
listener- The listener to remove.
-
getDirection
Gets the direction in which entities will be spawned by this instance.- Returns:
- the spawn direction
-
setDirection
Sets the direction in which entities will be spawned by this instance.- Parameters:
direction- the new spawn direction
-
getSpawnInfo
Gets the spawn information for this instance.- Returns:
- the spawn information
-
setSpawnInfo
Sets the spawn information for this instance.- Parameters:
spawnInfo- the new spawn information
-
getSpawnPivotType
Gets the spawn pivot type for this instance.- Returns:
- the spawn pivot type
-
setSpawnPivotType
Sets the spawn pivot type for this instance.- Parameters:
spawnPivotType- the new spawn pivot type
-
getSpawnOffsetX
public double getSpawnOffsetX()Gets the spawn offset on the X-axis for this instance.- Returns:
- the spawn offset on the X-axis
-
setSpawnOffsetX
public void setSpawnOffsetX(double spawnOffsetX) Sets the spawn offset on the X-axis for this instance.- Parameters:
spawnOffsetX- the new spawn offset on the X-axis
-
getSpawnOffsetY
public double getSpawnOffsetY()Gets the spawn offset on the Y-axis for this instance.- Returns:
- the spawn offset on the Y-axis
-
setSpawnOffsetY
public void setSpawnOffsetY(double spawnOffsetY) Sets the spawn offset on the Y-axis for this instance.- Parameters:
spawnOffsetY- the new spawn offset on the Y-axis
-
spawn
Spawns the specified entity to theEnvironmentof theSpawnpointor the currently activeEnvironment.Spawning will set the location of the entity to the location defined by the spawnpoint and optionally also set the angle of the entity, if a spawn direction is defined.
- Parameters:
entity- The entity to spawn at the specified location.- Returns:
- True if the entity was spawned; otherwise false, which is typically the case if no environment is loaded.
- See Also:
-