public abstract class AbstractTileMap
extends org.piccolo2d.PNode
FILL_STRATEGY_ASPECT_COVER, FILL_STRATEGY_ASPECT_FIT, FILL_STRATEGY_EXACT_FIT, PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATENO_SUCH_PAGE, PAGE_EXISTS| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTileMap(long mapWidth,
long mapHeight,
double tileWidth,
double tileHeight,
Matrix2D<Sprite> tileMap)
Create a new abstract tile map node.
|
| Modifier and Type | Method and Description |
|---|---|
void |
advance()
Advance this tile map node one frame.
|
long |
columns()
Return the number of columns for this tile map node.
|
void |
fill(Sprite tile)
Fill this tile map node with the specified tile.
|
void |
fillColumn(long column,
Sprite tile)
Fill the specified column in this tile map node with the specified tile.
|
void |
fillRow(long row,
Sprite tile)
Fill the specified row in this tile map node with the specified tile.
|
void |
fillRowColumn(long row,
long column,
long height,
long width,
Sprite tile)
Fill the specified part of this tile map node with the specified tile.
|
void |
fillX(long x,
Sprite tile)
Fill
[x, 0] to [x, getMapHeight()] in this tile map node with the specified tile. |
void |
fillXY(long x,
long y,
long width,
long height,
Sprite tile)
Fill the specified part of this tile map node with the specified tile.
|
void |
fillY(long y,
Sprite tile)
Fill
[0, y] to [getMapWidth(), y] in this tile map node with the specified tile. |
long |
getMapHeight()
Return the map height in number of tiles for this tile map node.
|
long |
getMapWidth()
Return the map width in number of tiles for this tile map node.
|
double |
getTileHeight()
Return the tile height for this tile map node.
|
Sprite |
getTileRowColumn(long row,
long column)
Return the tile at the specified row and column in this tile map node, if any.
|
double |
getTileWidth()
Return the tile width for this tile map node.
|
Sprite |
getTileXY(long x,
long y)
Return the tile at the specified x and y in this tile map node, if any.
|
protected void |
layoutChildren() |
void |
repaint() |
long |
rows()
Return the number of rows for this tile map node.
|
void |
setTileRowColumn(long row,
long column,
Sprite tile)
Set the tile at the specified row and column in this tile map node to
tile. |
void |
setTileXY(long x,
long y,
Sprite tile)
Set the tile at the specified x and y in this tile map node to
tile. |
addActivity, addAttribute, addChild, addChild, addChildren, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientPropertyKeysEnumeration, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInputEventListeners, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getName, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, internalUpdateBounds, intersects, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, lower, lower, lowerBelow, lowerToBottom, lowerToBottom, offset, paint, paintAfterChildren, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, print, print, raise, raise, raiseAbove, raiseToTop, raiseToTop, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setName, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaintprotected AbstractTileMap(long mapWidth,
long mapHeight,
double tileWidth,
double tileHeight,
Matrix2D<Sprite> tileMap)
mapWidth - map width in number of tiles, must be at least onemapHeight - map height in number of tiles, must be at least onetileWidth - tile width, must be greater than or equal to zerotileHeight - tile height, must be greater than or equal to zerotileMap - map of tiles, must not be null and must have dimensions
mapHeight x mapWidthpublic final long getMapWidth()
public final long columns()
public final long getMapHeight()
public final long rows()
public final double getTileWidth()
public final double getTileHeight()
public final void fill(Sprite tile)
tile - tile to fill withpublic final void fillY(long y,
Sprite tile)
[0, y] to [getMapWidth(), y] in this tile map node with the specified tile.y - y in this tile map node, must be >= 0 and < getMapHeight()tile - tile to fill withpublic final void fillRow(long row,
Sprite tile)
row - row in this tile map node, must be >= 0 and < getMapHeight()tile - tile to fill withpublic final void fillX(long x,
Sprite tile)
[x, 0] to [x, getMapHeight()] in this tile map node with the specified tile.x - x in this tile map node, must be >= 0 and < getMapWidth()tile - tile to fill withpublic final void fillColumn(long column,
Sprite tile)
column - column in this tile map node, must be >= 0 and < getMapWidth()tile - tile to fill withpublic final void fillXY(long x,
long y,
long width,
long height,
Sprite tile)
x - x in this tile map node, must be >= 0 and < getMapWidth()y - y in this tile map node, must be >= 0 and < getMapHeight()width - width in number of tilesheight - height in number of tilestile - tile to fill withpublic final void fillRowColumn(long row,
long column,
long height,
long width,
Sprite tile)
row - row in this tile map node, must be >= 0 and < getMapHeight()column - column in this tile map node, must be >= 0 and < getMapWidth()height - height in number of tileswidth - width in number of tilestile - tile to fill withpublic final void setTileXY(long x,
long y,
Sprite tile)
tile.x - x in this tile map node, must be >= 0 and < getMapWidth()y - y in this tile map node, must be >= 0 and < getMapHeight()tile - tilepublic final void setTileRowColumn(long row,
long column,
Sprite tile)
tile.row - row in this tile map node, must be >= 0 and < getMapHeight()column - column in this tile map node, must be >= 0 and < getMapWidth()tile - tilepublic final Sprite getTileXY(long x, long y)
x - x in this tile map node, must be >= 0 and < getMapWidth()y - y in this tile map node, must be >= 0 and < getMapHeight()null
if one does not existpublic final Sprite getTileRowColumn(long row, long column)
row - row in this tile map node, must be >= 0 and < getMapHeight()column - column in this tile map node, must be >= 0 and < getMapWidth()null
if one does not existpublic final void advance()
protected void layoutChildren()
layoutChildren in class org.piccolo2d.PNodepublic void repaint()
repaint in class org.piccolo2d.PNodeCopyright (c) 2006-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).