Events

@:dox(show)nameChange(current:String, previous:String):Void

Event when name field changes.

@:dox(show)xChange(current:Int, previous:Int):Void

Event when x field changes.

@:dox(show)yChange(current:Int, previous:Int):Void

Event when y field changes.

@:dox(show)columnsChange(current:Int, previous:Int):Void

Event when columns field changes.

@:dox(show)rowsChange(current:Int, previous:Int):Void

Event when rows field changes.

@:dox(show)opacityChange(current:Float, previous:Float):Void

Event when opacity field changes.

@:dox(show)visibleChange(current:Bool, previous:Bool):Void

Event when visible field changes.

@:dox(show)offsetXChange(current:Int, previous:Int):Void

Event when offsetX field changes.

@:dox(show)offsetYChange(current:Int, previous:Int):Void

Event when offsetY field changes.

@:dox(show)explicitDepthChange(current:Null<Float>, previous:Null<Float>):Void

Event when explicitDepth field changes.

@:dox(show)blendingChange(current:Blending, previous:Blending):Void

Event when blending field changes.

@:dox(show)colorChange(current:Color, previous:Color):Void

Event when color field changes.

@:dox(show)extraBlendingChange(current:Blending, previous:Blending):Void

Event when extraBlending field changes.

@:dox(show)extraOpacityChange(current:Float, previous:Float):Void

Event when extraOpacity field changes.

@:dox(show)tilesChange(current:ReadOnlyArray<TilemapTile>, previous:ReadOnlyArray<TilemapTile>):Void

Event when tiles field changes.

@:dox(show)tilesAlphaChange(current:ReadOnlyArray<Float>, previous:ReadOnlyArray<Float>):Void

Event when tilesAlpha field changes.

@:dox(show)tilesOffsetXChange(current:ReadOnlyArray<Int>, previous:ReadOnlyArray<Int>):Void

Event when tilesOffsetX field changes.

@:dox(show)tilesOffsetYChange(current:ReadOnlyArray<Int>, previous:ReadOnlyArray<Int>):Void

Event when tilesOffsetY field changes.

@:dox(show)computedTilesChange(current:ReadOnlyArray<TilemapTile>, previous:ReadOnlyArray<TilemapTile>):Void

Event when computedTiles field changes.

@:dox(show)computedTilesAlphaChange(current:ReadOnlyArray<Float>, previous:ReadOnlyArray<Float>):Void

Event when computedTilesAlpha field changes.

@:dox(show)computedTilesOffsetXChange(current:ReadOnlyArray<Int>, previous:ReadOnlyArray<Int>):Void

Event when computedTilesOffsetX field changes.

@:dox(show)computedTilesOffsetYChange(current:ReadOnlyArray<Int>, previous:ReadOnlyArray<Int>):Void

Event when computedTilesOffsetY field changes.

@:dox(show)hasTilesChange(current:Bool, previous:Bool):Void

Event when hasTiles field changes.

@:dox(show)shouldRenderTilesChange(current:Bool, previous:Bool):Void

Event when shouldRenderTiles field changes.

@:dox(show)tileWidthChange(current:Int, previous:Int):Void

Event when tileWidth field changes.

@:dox(show)tileHeightChange(current:Int, previous:Int):Void

Event when tileHeight field changes.

Constructor

new()

Variables

@:value(null)@serializename:String = null

The name of the layer

@:value(0)@serializex:Int = 0

The x position of the layer in tiles

@:value(0)@serializey:Int = 0

The y position of the layer in tiles

@:value(0)@serializecolumns:Int = 0

The width of the layer in tiles

@:value(0)@serializerows:Int = 0

The height of the layer in tiles

@:value(1)@serializeopacity:Float = 1

The opacity of the layer

@:value(true)@serializevisible:Bool = true

Whether this layer is visible or not

@:value(0)@serializeoffsetX:Int = 0

X offset for this layer in points.

@:value(0)@serializeoffsetY:Int = 0

Y offset for this layer in points.

@:value(null)@serializeexplicitDepth:Null<Float> = null

Explicit depth, or null of that should be computed by Tilemap instead

@:value(AUTO)@serializeblending:Blending = AUTO

Tile default blending

@:value(Color.WHITE)@serializecolor:Color = Color.WHITE

Tile default (tint) color

@:value(AUTO)@serializeextraBlending:Blending = AUTO

Extra tile default blending

@:value(1)@serializeextraOpacity:Float = 1

Extra tile default alpha

@:value(null)@serializetiles:ReadOnlyArray<TilemapTile> = null

Tiles

@:value(null)@serializetilesAlpha:ReadOnlyArray<Float> = null

Per-tile alpha, or null if there is no custom alpha per tile

@:value(null)@serializetilesOffsetX:ReadOnlyArray<Int> = null

Per-tile x offset in pixels, or null if there is no offset

@:value(null)@serializetilesOffsetY:ReadOnlyArray<Int> = null

Per-tile y offset in pixels, or null if there is no offset

@:value(null)@observecomputedTiles:ReadOnlyArray<TilemapTile> = null

Computed tiles, after applying auto-tiling (if any). Will be null if no auto-tiling is used.

@:value(null)@observecomputedTilesAlpha:ReadOnlyArray<Float> = null

Per-computed tile alpha, or null if there is no custom alpha per computed tile

@:value(null)@observecomputedTilesOffsetX:ReadOnlyArray<Int> = null

Per-computed tile x offset in pixels, or null if there is no offset per computed tile

@:value(null)@observecomputedTilesOffsetY:ReadOnlyArray<Int> = null

Per-computed tile y offset in pixels, or null if there is no offset per computed tile

read onlyhasTiles:Bool

Is true if this layer has tiles. Some layers don't have tile and don't need to be rendered with tilemap layer quads, but are still available as containers to add custom objects (like LDtk entities).

Returns:

Bool

@:value(true)@serializeshouldRenderTiles:Bool = true

Is true (default) if this layer should have its tiles rendered (if any).

@:value(-1)@serializetileWidth:Int = -1

The width of a tile in this layer

@:value(-1)@serializetileHeight:Int = -1

The height of a tile in this layer

Methods

Inherited Events

Defined by Model

@:dox(show)observedDirty(instance:Model, fromSerializedField:Bool):Void

Event when any observable value as changed on this instance.

@:dox(show)_modelDirty(model:Model):Void

@:dox(show)serialize():Void

Event when this object gets serialized.

@:dox(show)deserialize():Void

Event when this object gets deserialized.

@:dox(show)dispose(entity:Entity):Void

@:dox(show)destroy(entity:Entity):Void

Inherited Variables

Defined by Model

@:value(false)observedDirty:Bool = false

Default is false, automatically set to true when any of this instance's observable variables has changed.

@componentsharer:ShareModel

@:value(false)dirty:Bool = false

Defined by Entity

@:value(null)id:String = null

read onlydestroyed:Bool

read onlydisposed:Bool

@:value(null)read onlyautoruns:Array<Autorun> = null

components:ReadOnlyMap<String, Component>

Public components mapping. Contain components created separately with component() or macro-based components as well.

scriptContent:ScriptContent

Available with script plugin

script:Script

Available with script plugin

Inherited Methods

Defined by Model

Defined by Entity

destroy():Void

Destroy this entity. This method is automatically protected from duplicate calls. That means calling multiple times an entity's destroy() method will run the destroy code only one time. As soon as destroy() is called, the entity is marked destroyed=true, even when calling destroy() method on a subclass (a macro is inserting a code to mark the object as destroyed at the beginning of every destroy() override function.

dispose():Void

Schedules destroy, at the end of the current frame.

unbindEvents():Void

Remove all events handlers from this entity.

autorun(run:() ‑> Void, ?afterRun:() ‑> Void):Autorun

Creates a new Autorun instance with the given callback associated with the current entity.

Parameters:

run

The run callback

Returns:

The autorun instance

tween(?easing:Easing, duration:Float, fromValue:Float, toValue:Float, update:(Float, Float) ‑> Void):Tween

Start a tween associated with this entity.

Parameters:

easing

The easing to use

duration

The duration of the tween

fromValue

The start value of the tween

toValue

The end value of the tween

update

An update function called at each iteration of the tween

Returns:

The instance of the created Tween object

eagerTween(?easing:Easing, duration:Float, fromValue:Float, toValue:Float, update:(Float, Float) ‑> Void):Tween

Start an eager tween associated with this entity. This is the same as a regular tween, except that it will start updating itself using current frame's delta time instead of next frame like in a regular tween.

Parameters:

easing

The easing to use

duration

The duration of the tween

fromValue

The start value of the tween

toValue

The end value of the tween

update

An update function called at each iteration of the tween

Returns:

The instance of the created Tween object

@:value({ hasField : false })component<C>(?name:String, ?component:Null<C>, hasField:Bool = false):C