Events

@:dox(show)animationsChange(current:ReadOnlyArray<SpriteSheetAnimation>, previous:ReadOnlyArray<SpriteSheetAnimation>):Void

Event when animations field changes.

@:dox(show)atlasChange(current:TextureAtlas, previous:TextureAtlas):Void

Event when atlas field changes.

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

Event when gridWidth field changes.

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

Event when gridHeight field changes.

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

Event when source field changes.

Constructor

new()

Variables

@:value([])@serializeanimations:ReadOnlyArray<SpriteSheetAnimation> = []

@:value(null)@observeatlas:TextureAtlas = null

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

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

texture:Texture

The texture used to display sprites in this spritesheet. This is a shorthand of image.texture

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

The reference to the sprite sheet file

@:value(null)asset:SpriteAsset = null

The asset related to this sprite sheet (if any)

Methods

inlinegrid(gridWidth:Int, gridHeight:Int):Void

inlineaddGridAnimation(name:String, start:Int, end:Int, frameDuration:Float):SpriteSheetAnimation

inlineaddGridAnimation(name:String, cells:Array<Int>, frameDuration:Float):SpriteSheetAnimation

This can be used to configure animations on simple grid spritesheets.

Parameters:

name

Name of the animation to add

start

Start cell of the animation

end

End cell of the animation

frameDuration

Duration of a single frame

Returns:

SpriteSheetAnimation the resulting animation instance

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.

@:value(false)dirty:Bool = false

Defined by Entity

read onlyhasData:Bool

@:value(null)id:String = null

read onlydestroyed:Bool

read onlydisposed:Bool

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

@editablecomponents: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

component<C>(?name:String, ?component:Null<C>):C