public class TiledObjectTemplate extends TiledResource implements TiledCustomizable
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).
|
String |
getName()
Returns the name of objects with this template (the empty string by
default).
|
List<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.
|
Map<String,Object> |
getProperties()
Returns an unmodifiable Map view of this entity's custom properties.
|
Object |
getProperty(String name)
Returns the value of this entity's custom property with the specified
name, 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.
|
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, getReader
public final String getName()
public final 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 List<Point2D> getPoints()
public final TiledText getText()
public final Map<String,Object> getProperties()
TiledCustomizable
java.awt.Color
for a color, TiledFile for a file, and TiledObject for an object (unless
the object property is unset, in which case the value is null).getProperties
in interface TiledCustomizable
public final Object getProperty(String name)
TiledCustomizable
java.awt.Color
for a color, TiledFile for a file, and
TiledObject for an object (unless the object property is unset, in which
case the value is null).getProperty
in interface TiledCustomizable
name
- The name of the property whose value is to be returnedCopyright © 2020. All rights reserved.