LdtkLayerDefinition
Defines a layer type that can be used in levels.
Layers can be:
- IntGrid: Integer grid for collision maps, zones, etc.
- Entities: Container for entity instances
- Tiles: Manual tile placement
- AutoLayer: Rule-based automatic tile placement
Instance Members
The LdtkDefinitions
object this layer def belongs to
Type of the layer (IntGrid, Entities, Tiles or AutoLayer)
Only auto-layers
Opacity of the layer (0 to 1.0)
Width and height of the grid in pixels
User defined unique identifier
An array that defines extra optional info for each IntGrid value. WARNING: the array order is not related to actual IntGrid values! As user can re-order IntGrid values freely, you may value "2" before value "1" in this array.
Parallax horizontal factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect.
Parallax vertical factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect.
If true (default), a layer with a parallax factor will also be scaled up/down accordingly.
X offset of the layer, in pixels (IMPORTANT: this should be added to the LdtkLayerInstance
optional offset)
Y offset of the layer, in pixels (IMPORTANT: this should be added to the LdtkLayerInstance
optional offset)
Reference to the default Tileset UID being used by this layer definition.
WARNING: some layer instances might use a different tileset. So most of the time, you should probably use the tilesetDefUid
value found in layer instances.
Note: since version 1.0.0, the old autoTilesetDefUid
was removed and merged into this value.
Unique Int identifier
Contains all the auto-layer rule definitions.
If the tiles are smaller or larger than the layer grid, the pivot value will be used to position the tile relatively its grid cell.
If the tiles are smaller or larger than the layer grid, the pivot value will be used to position the tile relatively its grid cell.
Name | Type |
---|---|
name |
String |
Returns |
---|
LdtkAutoRuleGroup |
Name | Type |
---|---|
uid |
Int |
Returns |
---|
LdtkAutoLayerRuleDefinition |
Returns |
---|
String |
Name | Type | Default |
---|---|---|
defs |
LdtkDefinitions | (optional) |
json |
haxe.DynamicAccess<Dynamic> | (optional) |