ObjectLayer extends TileLayer implements Printable, PropertyBagHolder Uses PropertyBagTrait
Represents an object group.
Tags
Interfaces, Classes and Traits
- Printable
- Marks something as a printable layer.
- PropertyBagHolder
- Interface for all elements, which contains properties.
Table of Contents
- $color : string|null
- The color used to display the objects in this group.
- $drawObjects : array<string|int, mixed>
- All the objects in this layer.
- $drawOrder : string
- With which algorithm should the objects be drawn?
- $height : int|null
- The height of the layer in tiles. Always the same as the map height for fixed-size maps.
- $id : int|null
- Unique ID of the layer.
- $map : Map|null
- The map object, which holds this layer.
- $name : string|null
- The name of the layer.
- $offsetX : float
- Horizontal offset for this layer in pixels. Defaults to 0.
- $offsetY : float
- Vertical offset for this layer in pixels. Defaults to 0.
- $opacity : float|null
- The opacity of the layer as a value from 0 to 1.
- $order : int
- Which order in the map should this tileLayer be rendered.
- $propertyBag : PropertyBag|null
- $tintColor : string|null
- A color that is multiplied with any tiles drawn by this layer in #AARRGGBB or #RRGGBB format.
- $visible : bool
- Whether the layer is shown (1) or hidden (0).
- $width : int|null
- The width of the layer in tiles. Always the same as the map width for fixed-size maps.
- $x : int
- The x coordinate of the layer in tiles.
- $y : int
- The y coordinate of the layer in tiles.
- addDrawObject() : self
- getColor() : string|null
- getDrawObjects() : array<string|int, DrawObject>
- getDrawOrder() : string
- getHeight() : int|null
- getId() : int|null
- getMap() : Map|null
- getName() : string|null
- getOffsetX() : float
- getOffsetY() : float
- getOpacity() : float|null
- getOrder() : int
- getPropertyBag() : PropertyBag|null
- getTintColor() : string|null
- getWidth() : int|null
- getX() : int
- getY() : int
- isVisible() : bool
- removeDrawObject() : self
- setColor() : ObjectLayer
- setDrawOrder() : ObjectLayer
- setHeight() : ObjectLayer
- setId() : TileLayer
- setMap() : TileLayer
- setName() : TileLayer
- setOffsetX() : TileLayer
- setOffsetY() : TileLayer
- setOpacity() : TileLayer
- setOrder() : ObjectLayer
- setPropertyBag() : self
- setTintColor() : TileLayer
- setVisible() : TileLayer
- setWidth() : ObjectLayer
- setX() : ObjectLayer
- setY() : ObjectLayer
Properties
$color
The color used to display the objects in this group.
private
string|null
$color
= null
Tags
$drawObjects
All the objects in this layer.
private
array<string|int, mixed>
$drawObjects
= []
Tags
$drawOrder
With which algorithm should the objects be drawn?
private
string
$drawOrder
= 'topdown'
Tags
$height
The height of the layer in tiles. Always the same as the map height for fixed-size maps.
private
int|null
$height
Tags
$id
Unique ID of the layer.
private
int|null
$id
= null
Tags
$map
The map object, which holds this layer.
private
Map|null
$map
Tags
$name
The name of the layer.
private
string|null
$name
= null
Tags
$offsetX
Horizontal offset for this layer in pixels. Defaults to 0.
private
float
$offsetX
= 0.0
Tags
$offsetY
Vertical offset for this layer in pixels. Defaults to 0.
private
float
$offsetY
= 0.0
Tags
$opacity
The opacity of the layer as a value from 0 to 1.
private
float|null
$opacity
= 1.0
Tags
$order
Which order in the map should this tileLayer be rendered.
private
int
$order
= 0
Tags
$propertyBag
private
PropertyBag|null
$propertyBag
= null
Tags
$tintColor
A color that is multiplied with any tiles drawn by this layer in #AARRGGBB or #RRGGBB format.
private
string|null
$tintColor
= null
Tags
$visible
Whether the layer is shown (1) or hidden (0).
private
bool
$visible
= true
Tags
$width
The width of the layer in tiles. Always the same as the map width for fixed-size maps.
private
int|null
$width
Tags
$x
The x coordinate of the layer in tiles.
private
int
$x
= 0
Tags
$y
The y coordinate of the layer in tiles.
private
int
$y
= 0
Tags
Methods
addDrawObject()
public
addDrawObject(DrawObject $drawObject) : self
Parameters
- $drawObject : DrawObject
Return values
self —getColor()
public
getColor() : string|null
Return values
string|null —getDrawObjects()
public
getDrawObjects() : array<string|int, DrawObject>
Return values
array<string|int, DrawObject> —getDrawOrder()
public
getDrawOrder() : string
Return values
string —getHeight()
public
getHeight() : int|null
Return values
int|null —getId()
public
getId() : int|null
Return values
int|null —getMap()
public
getMap() : Map|null
Return values
Map|null —getName()
public
getName() : string|null
Return values
string|null —getOffsetX()
public
getOffsetX() : float
Return values
float —getOffsetY()
public
getOffsetY() : float
Return values
float —getOpacity()
public
getOpacity() : float|null
Return values
float|null —getOrder()
public
getOrder() : int
Return values
int —getPropertyBag()
public
getPropertyBag() : PropertyBag|null
Return values
PropertyBag|null —getTintColor()
public
getTintColor() : string|null
Return values
string|null —getWidth()
public
getWidth() : int|null
Return values
int|null —getX()
public
getX() : int
Return values
int —getY()
public
getY() : int
Return values
int —isVisible()
public
isVisible() : bool
Return values
bool —removeDrawObject()
public
removeDrawObject(DrawObject $drawObject) : self
Parameters
- $drawObject : DrawObject
Return values
self —setColor()
public
setColor(string|null $color) : ObjectLayer
Parameters
- $color : string|null
Return values
ObjectLayer —setDrawOrder()
public
setDrawOrder(string $drawOrder) : ObjectLayer
Parameters
- $drawOrder : string
Return values
ObjectLayer —setHeight()
public
setHeight(int|null $height) : ObjectLayer
Parameters
- $height : int|null
Return values
ObjectLayer —setId()
public
setId(int|null $id) : TileLayer
Parameters
- $id : int|null
Return values
TileLayer —setMap()
public
setMap(Map|null $map) : TileLayer
Parameters
- $map : Map|null
Return values
TileLayer —setName()
public
setName(string|null $name) : TileLayer
Parameters
- $name : string|null
Return values
TileLayer —setOffsetX()
public
setOffsetX(float $offsetX) : TileLayer
Parameters
- $offsetX : float
Return values
TileLayer —setOffsetY()
public
setOffsetY(float $offsetY) : TileLayer
Parameters
- $offsetY : float
Return values
TileLayer —setOpacity()
public
setOpacity(float|null $opacity) : TileLayer
Parameters
- $opacity : float|null
Return values
TileLayer —setOrder()
public
setOrder(int $order) : ObjectLayer
Parameters
- $order : int
Return values
ObjectLayer —setPropertyBag()
public
setPropertyBag(PropertyBag|null $propertyBag) : self
Parameters
- $propertyBag : PropertyBag|null
Return values
self —setTintColor()
public
setTintColor(string|null $tintColor) : TileLayer
Parameters
- $tintColor : string|null
Return values
TileLayer —setVisible()
public
setVisible(bool $visible) : TileLayer
Parameters
- $visible : bool
Return values
TileLayer —setWidth()
public
setWidth(int|null $width) : ObjectLayer
Parameters
- $width : int|null
Return values
ObjectLayer —setX()
public
setX(int $x) : ObjectLayer
Parameters
- $x : int
Return values
ObjectLayer —setY()
public
setY(int $y) : ObjectLayer
Parameters
- $y : int