Class StaticShadow
java.lang.Object
de.gurkenlabs.litiengine.entities.Entity
de.gurkenlabs.litiengine.entities.MapArea
de.gurkenlabs.litiengine.entities.StaticShadow
- All Implemented Interfaces:
EntityRenderedListener,EntityRenderListener,IEntity,Tweenable,EventListener
-
Field Summary
FieldsFields inherited from class de.gurkenlabs.litiengine.entities.Entity
ANY_MESSAGE -
Constructor Summary
ConstructorsConstructorDescriptionStaticShadow(double x, double y, float width, float height, StaticShadowType shadowType) Instantiates a newStaticShadowentity.StaticShadow(int id, double x, double y, float width, float height, StaticShadowType shadowType) Instantiates a newStaticShadowentity.StaticShadow(int id, String name, double x, double y, float width, float height, StaticShadowType shadowType) Instantiates a newStaticShadowentity.StaticShadow(CollisionBox collisionBox) Instantiates a newStaticShadowentity.StaticShadow(StaticShadowType shadowType) Instantiates a newStaticShadowentity.StaticShadow(StaticShadowType shadowType, int offset) Instantiates a newStaticShadowentity. -
Method Summary
Modifier and TypeMethodDescriptiongetArea()Gets the area of the static shadow.intGets the offset for the shadow.Gets the origin collision box of this static shadow.Gets the type of the static shadow.voidsetHeight(double height) Sets the height of the entity.voidsetLocation(Point2D location) Sets the map location.voidsetOffset(int shadowOffset) Sets the offset for the shadow and invalidates the current area.voidsetShadowType(StaticShadowType shadowType) Sets the type of the static shadow and invalidates the current area.voidsetWidth(double width) Sets the width of the entity.voidsetX(double x) Sets the X coordinate of the entity.voidsetY(double y) Sets the Y coordinate of the entity.toString()Returns a string representation of this static shadow.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, setLocation, setMapId, setName, setRenderType, setRenderWithLayer, setSize, setTweenValues, setVisible
-
Field Details
-
DEFAULT_COLOR
-
DEFAULT_OFFSET
public static final int DEFAULT_OFFSET- See Also:
-
-
Constructor Details
-
StaticShadow
Instantiates a newStaticShadowentity.- Parameters:
shadowType- The type of the static shadow.offset- The offset for the shadow.
-
StaticShadow
Instantiates a newStaticShadowentity.- Parameters:
shadowType- The type of the static shadow.
-
StaticShadow
Instantiates a newStaticShadowentity.- Parameters:
x- The x-coordinate of this instance.y- The y-coordinate of this instance.width- The width of this instance.height- The height of this instance.shadowType- The type of the static shadow.
-
StaticShadow
public StaticShadow(int id, double x, double y, float width, float height, StaticShadowType shadowType) Instantiates a newStaticShadowentity.- Parameters:
id- The id of this entity.x- The x-coordinate of this instance.y- The y-coordinate of this instance.width- The width of this instance.height- The height of this instance.shadowType- The type of the static shadow.
-
StaticShadow
public StaticShadow(int id, String name, double x, double y, float width, float height, StaticShadowType shadowType) Instantiates a newStaticShadowentity.- Parameters:
id- The id of this entity.name- The name of this entity.x- The x-coordinate of this instance.y- The y-coordinate of this instance.width- The width of this instance.height- The height of this instance.shadowType- The type of the static shadow.
-
StaticShadow
Instantiates a newStaticShadowentity.- Parameters:
collisionBox- The collision box from which this shadow instance originates from.
-
-
Method Details
-
getShadowType
Gets the type of the static shadow.- Returns:
- the current shadow type.
-
setShadowType
Sets the type of the static shadow and invalidates the current area.- Parameters:
shadowType- the new shadow type to set.
-
setX
-
setY
-
setWidth
-
setHeight
-
setLocation
Description copied from class:EntitySets the map location.- Specified by:
setLocationin interfaceIEntity- Overrides:
setLocationin classEntity- Parameters:
location- the new map location
-
getOrigin
Gets the origin collision box of this static shadow.- Returns:
- the origin collision box, or null if there is no origin.
-
toString
-
getArea
Gets the area of the static shadow. If the shadow type is NONE, returns null. If the area is not already created, it calls thecreateArea()method to generate it.- Returns:
- the area of the static shadow, or null if the shadow type is NONE.
-
getOffset
public int getOffset()Gets the offset for the shadow.- Returns:
- the shadow offset.
-
setOffset
public void setOffset(int shadowOffset) Sets the offset for the shadow and invalidates the current area.- Parameters:
shadowOffset- the new shadow offset to set.
-