LdtkLayerDefinition

ceramic.LdtkLayerDefinition (Class)

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


ldtk
type: LdtkLayerType

Type of the layer (IntGrid, Entities, Tiles or AutoLayer)


ldtk
autoSourceLayerDefUid: Int

Only auto-layers


ldtk
displayOpacity: Float

Opacity of the layer (0 to 1.0)


ldtk
gridSize: Int

Width and height of the grid in pixels


ldtk
identifier: String

User defined unique identifier


ldtk
intGridValues: Array<LdtkIntGridValue>

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.


ldtk
parallaxFactorX: Float

Parallax horizontal factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect.


ldtk
parallaxFactorY: Float

Parallax vertical factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect.


ldtk
parallaxScaling: Bool

If true (default), a layer with a parallax factor will also be scaled up/down accordingly.


ldtk
pxOffsetX: Int

X offset of the layer, in pixels (IMPORTANT: this should be added to the LdtkLayerInstance optional offset)


ldtk
pxOffsetY: Int

Y offset of the layer, in pixels (IMPORTANT: this should be added to the LdtkLayerInstance optional offset)


ldtk
tilesetDefUid: Int

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.


ldtk
uid: Int

Unique Int identifier


ldtk
autoRuleGroups: Array<LdtkAutoRuleGroup>

Contains all the auto-layer rule definitions.


ldtk
tilePivotX: Float

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.


ldtk
tilePivotY: Float

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.


ldtk
autoRuleGroup(name: String): LdtkAutoRuleGroup
Name Type
name String
Returns
LdtkAutoRuleGroup

ldtk
findRule(uid: Int): LdtkAutoLayerRuleDefinition
Name Type
uid Int
Returns
LdtkAutoLayerRuleDefinition

ldtk
toString(): String
Returns
String

Name Type Default
defs LdtkDefinitions (optional)
json haxe.DynamicAccess<Dynamic> (optional)