public class TiledObjectTemplate extends TiledResource
A TiledObjectTemplate represents a template from which TiledObjects can borrow their default properties. It corresponds to a <template> tag in a Tiled XML file.
Modifier and Type | Method and Description |
---|---|
float |
getHeight()
Returns the height in pixels of objects with this template (0 by
default).
|
java.lang.String |
getName()
Returns the name of objects with this template (the empty string by
default).
|
java.util.List<java.awt.geom.Point2D> |
getPoints()
Returns an unmodifiable List view of the sequence of vertex (x, y)
coordinates of objects with this template, if this template is for a
polygon or polyline.
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Returns an unmodifiable Map view of the custom properties of objects with
this template.
|
java.lang.Object |
getProperty(java.lang.String name)
Returns the value of the custom property with the specified name of
objects with this template, or null if no such property was specified.
|
float |
getRotation()
Returns the rotation in clockwise degrees of objects with this template
(0 by default).
|
TiledObject.Shape |
getShape()
Returns the shape of objects with this template
(
TiledObject.Shape.RECTANGLE by default). |
TiledText |
getText()
Returns the text of objects with this template, if this template is for a
text object.
|
TiledTile |
getTile()
Returns the tile that represents objects with this template, if this
template is for a tile object.
|
boolean |
getTileDFlip()
Returns whether the the tile that represents objects with this template
is flipped diagonally, if this template is for a tile object.
|
boolean |
getTileXFlip()
Returns whether the the tile that represents objects with this template
is flipped horizontally, if this template is for a tile object.
|
boolean |
getTileYFlip()
Returns whether the the tile that represents objects with this template
is flipped vertically, if this template is for a tile object.
|
java.lang.String |
getType()
Returns the type of objects with this template (the empty string by
default).
|
boolean |
getVisible()
Returns whether objects with this template are marked as visible (true by
default).
|
float |
getWidth()
Returns the width in pixels of objects with this template (0 by default).
|
getPath
public final java.lang.String getName()
public final java.lang.String getType()
public final float getWidth()
public final float getHeight()
public final float getRotation()
public final TiledTile getTile()
public final boolean getTileXFlip()
public final boolean getTileYFlip()
public final boolean getTileDFlip()
public final boolean getVisible()
public final TiledObject.Shape getShape()
TiledObject.Shape.RECTANGLE
by default).public final java.util.List<java.awt.geom.Point2D> getPoints()
public final TiledText getText()
public final java.util.Map<java.lang.String,java.lang.Object> getProperties()
java.awt.Color
for a color, java.io.File
for a
file, and TiledObject for an object (unless the object property is unset,
in which case the value is null).public final java.lang.Object getProperty(java.lang.String name)
java.awt.Color
for a color,
java.io.File
for a file, and TiledObject for an object
(unless the object property is unset, in which case the value is null).name
- The name of the property whose value is to be returned