Logo


search API (or start typing anywhere)


Assets

snow.systems.assets.Assets defined in ``

The asset system class gives you access to fetching and manipulating assets, handling loading files and data in a consistent cross platform way


class
meta: @:allow(snow.Snow)


 

Members


app
app : snow.Snow
access to snow from subsystems
module
module : snow.types.ModuleAssets
access to module implementation
root
root : String
If the assets are not relative to the runtime root path, this value can adjust all asset paths. This is automatically handled and exists to allow control.

Methods


audioinline
audio(_id:String, _is_stream:Bool) : snow.api.Promise
Get an asset as an AssetAudio, data stored as AudioData, using the default processor and provider

audio_from_bytesinline

audio_from_bytes(_id:String, _bytes:snow.api.buffers.Uint8Array, _format:snow.types.AudioFormatType) : snow.api.Promise
Get an asset as an AssetAudio, data stored as AudioData, created from audio file bytes.

bytesinline

bytes(_id:String) : snow.api.Promise
Get an asset as an AssetBytes, data stored as Uint8Array, using the default processor and provider

imageinline

image(_id:String) : snow.api.Promise
Get an asset as an AssetImage, data stored as ImageData, using the default processor and provider

image_from_bytesinline

image_from_bytes(_id:String, _bytes:snow.api.buffers.Uint8Array) : snow.api.Promise
Get an asset as an AssetImage, data stored as ImageData, created from image file bytes (not pixels).

image_from_pixelsinline

image_from_pixels(_id:String, _width:Int, _height:Int, _pixels:snow.api.buffers.Uint8Array) : snow.types.AssetImage
Get an asset as an AssetImage, data stored as ImageData, created from image file pixels

jsoninline

json(_id:String) : snow.api.Promise
Get an asset as an AssetJSON, data stored as Dynamic, using the default processor and provider

pathinline

path(_id:String) : String
Get the asset path for an asset, adjusted by platform, root etc.

textinline

text(_id:String) : snow.api.Promise
Get an asset as an AssetText, data stored as String, using the default processor and provider