Class MapObject
java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
de.gurkenlabs.litiengine.environment.tilemap.xml.MapObject
- All Implemented Interfaces:
ICustomPropertyProvider,IMapObject,Resource,Comparable<Resource>
- Direct Known Subclasses:
Blueprint
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a newMapObjectinstance.Instantiates a newMapObjectinstance by copying the specified original instance.Instantiates a newMapObjectinstance by copying the specified original instance.Instantiates a newMapObjectinstance by copying the specified original instance.Instantiates a newMapObjectinstance. -
Method Summary
Modifier and TypeMethodDescriptionGets the hit box.static Rectangle2DgetBounds(IMapObject... objects) static Rectangle2DgetBounds(Iterable<IMapObject> objects) intGets the grid id.floatintgetId()Gets the id.getLayer()Gets the location.getName()Gets the name.getText()getTile()getType()Gets the type.floatgetWidth()floatgetX()floatgetY()booleanbooleanisPoint()booleanbooleanvoidsetGridId(int gid) voidsetHeight(float height) voidsetId(int id) protected voidsetLayer(MapObjectLayer layer) voidsetLocation(float x, float y) voidsetLocation(Point2D location) voidvoidsetPolygon(IPolyShape polygon) voidsetPolyline(IPolyShape polyline) voidvoidsetWidth(float width) voidsetX(float x) voidsetY(float y) toString()Methods inherited from class de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getCharValue, getCharValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getMapObjectId, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, hasCustomProperty, removeProperty, setProperties, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface de.gurkenlabs.litiengine.environment.tilemap.ICustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getCharValue, getCharValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getMapObjectId, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, hasCustomProperty, removeProperty, setProperties, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue
-
Constructor Details
-
MapObject
public MapObject()Instantiates a newMapObjectinstance. -
MapObject
Instantiates a newMapObjectinstance.- Parameters:
type- The type of this map object.
-
MapObject
Instantiates a newMapObjectinstance by copying the specified original instance.This variant of the constructor will assign an entirely new ID to the newly created MapObject.
- Parameters:
original- the MapObject we want to copy
-
MapObject
Instantiates a newMapObjectinstance by copying the specified original instance.This variant of the constructor lets you decide if the copy instance will get the same ID as the old MapObject or get a new ID.
- Parameters:
original- the MapObject we want to copykeepID- decide if the new instance will adopt the old MapObject's ID or get a new, unique one.
-
MapObject
Instantiates a newMapObjectinstance by copying the specified original instance.- Parameters:
original- the MapObject we want to copyid- The id of this instance.
-
-
Method Details
-
getBounds
-
getBounds
-
getGridId
public int getGridId()Description copied from interface:IMapObjectGets the grid id.- Specified by:
getGridIdin interfaceIMapObject- Returns:
- the grid id
-
getTile
- Specified by:
getTilein interfaceIMapObject
-
getBoundingBox
Description copied from interface:IMapObjectGets the hit box.- Specified by:
getBoundingBoxin interfaceIMapObject- Returns:
- the hit box
-
getId
public int getId()Description copied from interface:IMapObjectGets the id.- Specified by:
getIdin interfaceIMapObject- Returns:
- the id
-
getLocation
Description copied from interface:IMapObjectGets the location.- Specified by:
getLocationin interfaceIMapObject- Returns:
- the location
-
getName
-
getType
Gets the type.- Specified by:
getTypein interfaceIMapObject- Returns:
- the type
-
getPolyline
- Specified by:
getPolylinein interfaceIMapObject
-
getPolygon
- Specified by:
getPolygonin interfaceIMapObject
-
getEllipse
- Specified by:
getEllipsein interfaceIMapObject
-
getText
- Specified by:
getTextin interfaceIMapObject
-
setGridId
public void setGridId(int gid) - Specified by:
setGridIdin interfaceIMapObject
-
setHeight
public void setHeight(float height) - Specified by:
setHeightin interfaceIMapObject
-
setId
public void setId(int id) - Specified by:
setIdin interfaceIMapObject
-
setName
-
setType
- Specified by:
setTypein interfaceIMapObject
-
setWidth
public void setWidth(float width) - Specified by:
setWidthin interfaceIMapObject
-
setX
public void setX(float x) - Specified by:
setXin interfaceIMapObject
-
setY
public void setY(float y) - Specified by:
setYin interfaceIMapObject
-
setLocation
- Specified by:
setLocationin interfaceIMapObject
-
setLocation
public void setLocation(float x, float y) - Specified by:
setLocationin interfaceIMapObject
-
toString
-
getX
public float getX()- Specified by:
getXin interfaceIMapObject
-
getY
public float getY()- Specified by:
getYin interfaceIMapObject
-
setPolyline
- Specified by:
setPolylinein interfaceIMapObject
-
setPolygon
- Specified by:
setPolygonin interfaceIMapObject
-
getWidth
public float getWidth()- Specified by:
getWidthin interfaceIMapObject
-
getHeight
public float getHeight()- Specified by:
getHeightin interfaceIMapObject
-
getLayer
- Specified by:
getLayerin interfaceIMapObject
-
isPolyline
public boolean isPolyline()- Specified by:
isPolylinein interfaceIMapObject
-
isPolygon
public boolean isPolygon()- Specified by:
isPolygonin interfaceIMapObject
-
isPoint
public boolean isPoint()- Specified by:
isPointin interfaceIMapObject
-
isEllipse
public boolean isEllipse()- Specified by:
isEllipsein interfaceIMapObject
-
setLayer
-