Events

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

Event when firstGid field changes.

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

Event when name 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.

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

Event when spacing field changes.

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

Event when margin field changes.

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

Event when tileCount 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)imageChange(current:TilesetImage, previous:TilesetImage):Void

Event when image field changes.

@:dox(show)gridOrientationChange(current:TilesetGridOrientation, previous:TilesetGridOrientation):Void

Event when gridOrientation field changes.

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

Event when gridCellWidth field changes.

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

Event when gridCellHeight field changes.

@:dox(show)slopesChange(current:ReadOnlyArray<TileSlope>, previous:ReadOnlyArray<TileSlope>):Void

Event when slopes field changes.

Constructor

new()

Variables

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

First global id. Maps to the first tile in this tileset.

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

The name of this tileset

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

The (maximum) width of tiles in this tileset

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

The (maximum) height of tiles in this tileset

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

The spacing between tiles in this tileset

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

The margin around the tiles in this tileset

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

The number of tiles in this tileset

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

The number of tile columns in this tileset

read onlyrows:Int

The number of tile rows in this tileset

@:value(null)@serializeimage:TilesetImage = null

The image used to display tiles in this tileset

@:value(ORTHOGONAL)@serializegridOrientation:TilesetGridOrientation = ORTHOGONAL

Orientation of the grid for the tiles in this tileset. Only used in case of isometric orientation, to determine how tile overlays for terrain an collision information are rendered.

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

Width of a grid cell. Only used in case of isometric orientation, to determine how tile overlays for terrain an collision information are rendered.

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

Height of a grid cell. Only used in case of isometric orientation, to determine how tile overlays for terrain an collision information are rendered.

texture:Texture

The texture used to display tiles in this tileset. This is a shorthand of image.texture

@:value(null)@serializeslopes:ReadOnlyArray<TileSlope> = null

Slopes in this tileset or null if there is no slope.

Methods

tileSize(tileWidth:Int, tileHeight:Int):Void

A shorthand to set tileWidth and tileHeight

Parameters:

tileWidth
null

tileHeight

gidAtPosition(column:Float, row:Float):Int

Get the global id from the given column and row coordinates

inlinecolumnForGid(gid:Int):Int

inlinerowForGid(gid:Int):Int

inlineslope(slope:TileSlope):Void

inlineslope(index:Int):TileSlope

inlineslope(index:Int, slope:TileSlope):Void

Add a slope to this tileset.

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

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