Available on all targets
@:dox(show)replaceFont(newFont:BitmapFont, prevFont:BitmapFont):Void
@:dox(show)fontChange(current:BitmapFont, previous:BitmapFont):Void
Event when font field changes.
new(name:String, ?variant:String, ?options:Null<AssetOptions>)
@:value(null)fontData:BitmapFontData = null
@:value(null)pages:Map<String, Texture> = null
@:value(null)@observefont:BitmapFont = null
invalidateFont():Void
@: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.
@:dox(show)dispose(entity:Entity):Void
@:dox(show)destroy(entity:Entity):Void
@:value(false)observedDirty:Bool = false
Default is false, automatically set to true when any of this instance's observable variables has changed.
false
true
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.
retain()
release()
@:value(NONE)@observestatus:AssetStatus = NONE
read onlyhasData:Bool
data:Dynamic
@: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.
component()
scriptContent:ScriptContent
Available with script plugin
script:Script
invalidateStatus():Void
computePath(?extensions:Array<String>, ?dir:Bool, ?runtimeAssets:RuntimeAssets):Void
retain():Void
release():Void
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.
Autorun
Parameters:
run
The run callback
Returns:
The autorun instance
tween(?easing:Easing, duration:Float, fromValue:Float, toValue:Float, update:(Float, Float) ‑> Void):Tween
className():String
inlineclearComponents():Void
component<C>(?name:String, ?component:Null<C>):C
hasComponent(name:String):Bool
removeComponent(name:String):Void