new Layer( [init])
A main layer definition.
A main layer definition.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
init |
Object |
<optional> |
A generic object containing properties with which to populate the newly instance. If this argument is null, it is ignored. |
Extends
Members
-
height :number
-
The height of the object, in tiles.
Type:
- number
- Default Value:
-
- 0
-
name :string
-
The name of the object. An arbitrary string.
Type:
- string
- Default Value:
-
- null
-
<constant> offset :graphics.geom.Point
-
The rendering offset for this layer in pixels. Defaults to new Point(0,0).
Type:
-
offsetx :number
-
Rendering offset for this layer in pixels. Defaults to 0. (since 0.14)
Type:
- number
- Default Value:
-
- 0
-
offsety :number
-
Rendering offset for this layer in pixels. Defaults to 0. (since 0.14)
Type:
- number
- Default Value:
-
- 0
-
opacity :number
-
The opacity of the layer as a value from 0 to 1. Defaults to 1.
Type:
- number
- Default Value:
-
- 0
-
visible :boolean
-
Whether the layer is shown (
true
) or hidden (false
). Defaults totrue
. (since 0.9)Type:
- boolean
- Default Value:
-
- true
-
width :number
-
The width of the layer, in tiles.
Type:
- number
- Default Value:
-
- 0
-
x :number
-
The x coordinate of the layer in tiles. Defaults to 0 and can no longer be changed in Tiled Qt.
Type:
- number
- Default Value:
-
- 0
-
y :number
-
The y coordinate of the layer in tiles. Defaults to 0 and can no longer be changed in Tiled Qt.
Type:
- number
- Default Value:
-
- 0
Methods
-
clone()
-
Returns a shallow copy of the object.
- Inherited From:
Returns:
a shallow copy of the object.
-
setTo(init)
-
Sets the members of the object to the specified values.
Parameters:
Name Type Description init
Object The generic object to initialize the object.
- Inherited From:
Returns:
The current object reference.
-
toObject()
-
Returns the Object representation of this object.
- Overrides:
Returns:
the Object representation of this object.
-
toObject()
-
Returns the Object representation of this object.
- Overrides:
Returns:
the Object representation of this object.
-
toObject()
-
Returns the Object representation of this object.
- Overrides:
Returns:
the Object representation of this object.
-
toString()
-
Returns the string representation of this object.
- Inherited From:
Returns:
the string representation of this object.