Events

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

Event when any observable value as changed on this instance.

@:dox(show)complete(success:Bool):Void

@:dox(show)statusChange(current:AssetStatus, previous:AssetStatus):Void

Event when status field changes.

Constructor

new(kind:String, name:String, ?variant:String, ?options:Null<AssetOptions>)

Variables

@:value(false)observedDirty:Bool = false

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

read onlykind:String

Asset kind

name:String

Asset name

variant:String

Asset variant

read onlyfullName:String

Asset full name (including variant, if provided)

path:String

Asset path

read onlyallPaths:Array<String>

All paths related to this asset

@:value(1.0)read onlydensity:Float = 1.0

Asset target density. Some assets depend on current screen density, like bitmap fonts, textures. Default is 1.0

read onlyowner:Assets

Asset owner. The owner is a group of assets (Assets instance). When the owner gets destroyed, every asset it owns get destroyed as well.

runtimeAssets:RuntimeAssets

Optional runtime assets, used to compute path.

read onlyoptions:AssetOptions

Asset options. Depends on asset kind and even backend in some cases.

@:value(null)read onlyassets:Assets = null

Sub assets-list. Defaults to null but some kind of assets (like bitmap fonts) instanciate it to load sub-assets it depends on.

@:value(0)read onlyrefCount:Int = 0

Manage asset retain count. Increase it by calling retain() and decrease it by calling release(). This can be used when mutliple objects are using the same assets without knowing in advance when they will be needed.

@:value(NONE)@observestatus:AssetStatus = NONE

Methods

Inherited Events

Defined by Entity

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

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

Inherited Variables

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