Events

@:dox(show)reset():Void

Static variables

@:value(null)staticcurrent:Autorun = null

Static methods

staticunobserve():Void

Ensures current autorun won't be affected by the code after this call. reobserve() should be called to restore previous state.

staticreobserve():Void

Resume observing values and resume affecting current autorun scope. This should be called after an unobserve() call.

staticcease():Void

Unbinds and destroys current autorun. The name cease() has been chosed there so that it is unlikely to collide with other more common names suchs as stop, unbind etc... and should make it more recognizable, along with observe() and unobserve().

staticunobserved(func:() ‑> Void):Void

Executes the given function synchronously and ensures the current autorun scope won't be affected

Constructor

new(onRun:() ‑> Void, ?afterRun:() ‑> Void)

Initialize a new autorun.

Parameters:

onRun

The callback that will be executed and used to compute implicit bindings

afterRun

(optional) A callback run right after onRun, not affecting implicit bindings. Useful when generating side effects without messing up binding dependencies.

Variables

@:value(false)read onlyinvalidated:Bool = false

Methods

Inherited Events

Defined by Entity

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

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

Inherited Variables

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 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