Class CollisionBox
java.lang.Object
de.gurkenlabs.litiengine.entities.Entity
de.gurkenlabs.litiengine.entities.CollisionEntity
de.gurkenlabs.litiengine.entities.CollisionBox
- All Implemented Interfaces:
EntityRenderedListener
,EntityRenderListener
,ICollisionEntity
,IEntity
,Tweenable
,EventListener
The
CollisionBox
class represents a collision entity in the game. It extends the CollisionEntity
class and provides additional
properties and methods specific to collision boxes.
This class is annotated with various annotations to define its behavior and properties in the game environment, such as rendering type, collision information, and map object type.
-
Field Summary
Fields inherited from class de.gurkenlabs.litiengine.entities.Entity
ANY_MESSAGE
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a newCollisionBox
entity.CollisionBox
(boolean obstructingLight) Instantiates a newCollisionBox
entity.CollisionBox
(double width, double height) Instantiates a newCollisionBox
entity.CollisionBox
(double x, double y, double width, double height) Instantiates a newCollisionBox
entity.CollisionBox
(Rectangle2D box) Instantiates a newCollisionBox
entity. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if this instance is obstructing light.Methods inherited from class de.gurkenlabs.litiengine.entities.CollisionEntity
canCollideWith, fireCollisionEvent, getCollisionBox, getCollisionBox, getCollisionBox, getCollisionBoxAlign, getCollisionBoxCenter, getCollisionBoxHeight, getCollisionBoxValign, getCollisionBoxWidth, getCollisionType, getTweenValues, hasCollision, onCollision, refreshCollisionBox, removeCollisionListener, setCollision, setCollisionBoxAlign, setCollisionBoxHeight, setCollisionBoxValign, setCollisionBoxWidth, setCollisionType, setHeight, setLocation, setSize, setTweenValues, setWidth
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, 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, setVisible, setX, setY, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.gurkenlabs.litiengine.entities.IEntity
actions, addController, addEntityRenderListener, addListener, addTag, addTransformListener, animations, attachControllers, behavior, detachControllers, getAngle, getBoundingBox, getCenter, getController, getEnvironment, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getWidth, getX, getY, hasTag, isLoaded, isVisible, loaded, onMessage, onMessage, onRendered, perform, register, removed, removeListener, removeListener, removeListener, removeListener, removeListener, removeTag, renderWithLayer, sendMessage, setAngle, setController, setLocation, setMapId, setName, setRenderType, setRenderWithLayer, setVisible, setX, setY
-
Constructor Details
-
CollisionBox
public CollisionBox()Instantiates a newCollisionBox
entity. -
CollisionBox
public CollisionBox(boolean obstructingLight) Instantiates a newCollisionBox
entity.- Parameters:
obstructingLight
- A flag indicating whether this instance should obstruct lights.
-
CollisionBox
public CollisionBox(double width, double height) Instantiates a newCollisionBox
entity.- Parameters:
width
- The width of this instance.height
- The height of this instance.
-
CollisionBox
public CollisionBox(double x, double y, double width, double height) Instantiates a newCollisionBox
entity.- 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.
-
CollisionBox
Instantiates a newCollisionBox
entity.- Parameters:
box
- The rectangle defining the location and dimension of this instnace.
-
-
Method Details
-
isObstructingLight
public boolean isObstructingLight()Checks if this instance is obstructing light.- Returns:
true
if this instance is obstructing light;false
otherwise.
-