View source
class AssetLoader
package feathers.controls
extends FeathersControl › MeasureSprite › ValidatingSprite
Loads and displays an asset using either OpenFL's asset management system or from a URL.
Supports assets of the following types:
Available since
1.0.0
.See:
Constructor
Variables
scaleMode:StageScaleMode = StageScaleMode.SHOW_ALL
Determines how the asset will be scaled within the width and height of
the AssetLoader
instance. Uses the same constants from
StageScaleMode
that are used to scale the OpenFL stage.
The following example maintains the aspect ratio of the asset, but displays no border, and may crop it to fit:
loader.scaleMode = StageScaleMode.NO_BORDER
Available since
1.0.0
.See:
source:String
Sets the loader's source, which may be either the name of an asset or a URL to load the asset from the web instead.
The following example sets the source to an asset name:
loader.source = "my-asset-name";
The following example sets the source to a URL:
loader.source = "https://example.com/my-asset.png";
Available since
1.0.0
.