public class TiledObject
extends java.lang.Object
A TiledObject represents a Tiled object in an object layer, or as part of the specification of a tile's collision properties. It corresponds to an <object> tag inside an <objectgroup> tag in a Tiled XML file.
Modifier and Type | Class and Description |
---|---|
static class |
TiledObject.Shape
Represents a shape that a Tiled object can take, such as an ellipse or
polygon.
|
Modifier and Type | Method and Description |
---|---|
float |
getHeight()
Returns this object's height in pixels (0 by default).
|
java.lang.String |
getName()
Returns this object's name (the empty string by default).
|
java.util.List<java.awt.geom.Point2D> |
getPoints()
Returns an unmodifiable List view of this sequence of vertex (x, y)
coordinates of this object, if it is a polygon or polyline.
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Returns an unmodifiable Map view of this object's custom properties.
|
java.lang.Object |
getProperty(java.lang.String name)
Returns the value of this object's custom property with the specified
name, or null if no such property was specified.
|
float |
getRotation()
Returns the rotation of this object in clockwise degrees (0 by default).
|
TiledObject.Shape |
getShape()
Returns this object's shape (
TiledObject.Shape.RECTANGLE by
default). |
TiledObjectTemplate |
getTemplate()
Returns the template from which this object inherits its default
properties, or null if no template was specified.
|
TiledText |
getText()
Returns the text of this object, if it is a text object.
|
TiledTile |
getTile()
Returns the tile that represents this object, if it is a tile object.
|
boolean |
getTileDFlip()
Returns whether the tile that represents this object is flipped
diagonally, if this object is a tile object.
|
boolean |
getTileXFlip()
Returns whether the tile that represents this object is flipped
horizontally, if this object is a tile object.
|
boolean |
getTileYFlip()
Returns whether the tile that represents this object is flipped
vertically, if this object is a tile object.
|
java.lang.String |
getType()
Returns this object's type (the empty string by default).
|
boolean |
getVisible()
Returns whether this object is marked as visible (true by default).
|
float |
getWidth()
Returns this object's width in pixels (0 by default).
|
float |
getX()
Returns this object's x-coordinate in pixels.
|
float |
getY()
Returns this object's y-coordinate in pixels.
|
public final java.lang.String getName()
public final java.lang.String getType()
public final float getX()
public final float getY()
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 returnedpublic final TiledObjectTemplate getTemplate()