public class TileGridObject extends SpaceObject
A TileGridObject is a type of SpaceObject that spatially instantiates a TileGrid, which is specified upon the TileGridObject's creation. When a TileGridObject is constructed, the TileGrid is set as the TileGridObject's appearance, and the TileGridObject's locator Hitbox is set as a RectangleHitbox whose origin and edges match those of the TileGrid. Since TileGrids cannot be visually flipped or rotated, TileGridObjects should not be flipped or rotated themselves.
TileGrid
Constructor and Description |
---|
TileGridObject(CellVector position,
TileGrid grid,
int drawPriority,
boolean addAnimInstances)
Constructs a TileGridObject.
|
TileGridObject(long x,
long y,
TileGrid grid,
int drawPriority,
boolean addAnimInstances)
Constructs a TileGridObject.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<RectangleHitbox> |
cover()
Returns a list of non-overlapping RectangleHitboxes, representing regions
of the space in which this TileGridObject exists, that collectively
overlap or "cover" all and only the grid cells in this TileGridObject's
TileGrid that are occupied by tiles.
|
TileGrid |
getGrid()
Returns the TileGrid that this TileGridObject instantiates.
|
addAnimInstance, addAnimInstance, angleTo, boundingBoxesMeet, changeAngle, changePosition, changePosition, changeX, changeY, clearAnimInstances, distanceTo, draw, flipX, flipY, getAlpha, getAngle, getAngleX, getAngleY, getAnimation, getAnimation, getAnimInstance, getAnimInstance, getAppearance, getBottomEdge, getCenter, getCenterOffset, getCenterOffsetX, getCenterOffsetY, getCenterX, getCenterY, getDrawPriority, getEffectiveTimeFactor, getFilter, getGame, getGameState, getHeight, getLeftEdge, getLocatorHitbox, getNewGameState, getNumAnimInstances, getOverlapHitbox, getPosition, getRightEdge, getSolidHitbox, getTimeFactor, getTopEdge, getWidth, getX, getXFlip, getXSign, getY, getYFlip, getYSign, intersectingSolidObject, intersectingSolidObjects, isIntersectingSolidObject, isOverlappingObject, isSolid, isVisible, isVisible, nearestObject, nearestObjectWithinCircle, nearestObjectWithinCircle, nearestObjectWithinRadius, nearestObjectWithinRectangle, nearestOverlappingObject, objectIsWithinRadius, objectsWithinRadius, objectWithinRadius, overlap, overlappingObject, overlappingObjects, overlaps, removeAnimInstance, setAlpha, setAngle, setAnimation, setAnimation, setAnimInstance, setAnimInstance, setAppearance, setCenterOffset, setCenterOffset, setCenterOffsetX, setCenterOffsetY, setDrawPriority, setFilter, setGameState, setLocatorHitbox, setOverlapHitbox, setPosition, setPosition, setSolid, setSolidHitbox, setSurfaceSolid, setTimeFactor, setX, setXFlip, setY, setYFlip, surfaceIsSolid
public TileGridObject(CellVector position, TileGrid grid, int drawPriority, boolean addAnimInstances)
position
- This TileGridObject's initial positiongrid
- The TileGrid that this TileGridObject instantiatesdrawPriority
- This TileGridObject's initial draw priorityaddAnimInstances
- If this is true, this TileGridObject will, find
all of its TileGrid's tiles that are AnimationInstances, and add them to
itself without integer IDs. This will synchronize the passage of time for
these AnimationInstances with the passage of time for the TileGridObject
itself. This process only occurs upon the TileGridObject's construction,
so if this option is used, undesirable behavior may occur if the
TileGrid's tiles are modified after the TileGridObject is constructed,
but before it is discarded.public TileGridObject(long x, long y, TileGrid grid, int drawPriority, boolean addAnimInstances)
x
- The x-coordinate of this TileGridObject's initial positiony
- The y-coordinate of this TileGridObject's initial positiongrid
- The TileGrid that this TileGridObject instantiatesdrawPriority
- This TileGridObject's initial draw priorityaddAnimInstances
- If this is true, this TileGridObject will, find
all of its TileGrid's tiles that are AnimationInstances, and add them to
itself without integer IDs. This will synchronize the passage of time for
these AnimationInstances with the passage of time for the TileGridObject
itself. This process only occurs upon the TileGridObject's construction,
so if this option is used, undesirable behavior may occur if the
TileGrid's tiles are modified after the TileGridObject is constructed,
but before it is discarded.public final TileGrid getGrid()
public final java.util.List<RectangleHitbox> cover()