Skip to main content

Assets

APIs for image assets and rendering options.


Image

Drawable image asset.

Attributes

AttributeTypeDescription
widthnumberWidth in pixels (read-only)
heightnumberHeight in pixels (read-only)

See Also: Renderer.drawImage


ImageFilter

Defines image sampling behavior during scaling or transformation.

Values

ValueDescription
bilinearSmooth filtering (default)
nearestPixel-perfect, no interpolation

See Also: Image, ImageSampler


ImageSampler

Sampling parameters applied when drawing an image, combining wrapping and filtering behavior.

Constructor

ImageSampler(wrapX, wrapY, filter)

Creates an ImageSampler with the specified wrapping and filtering options.

ImageSampler(wrapX: ImageWrap, wrapY: ImageWrap, filter: ImageFilter): ImageSampler

Example

local sampler = ImageSampler("clamp", "clamp", "bilinear")
renderer:drawImage(image, sampler, "srcOver", 1.0)

See Also: ImageFilter, ImageWrap


ImageWrap

Defines how texture coordinates outside the [0, 1] range are handled.

Values

ValueDescription
clampClamps coordinates to [0, 1] range
repeatTiles the texture by repeating
mirrorMirrors the texture at boundaries

See Also: ImageSampler, Image


Blob

Binary data asset accessed via context:blob(name).

Attributes

AttributeTypeDescription
namestringAsset name (read-only)
sizenumberData size in bytes (read-only)
databufferRaw binary data (read-only)

See Also: Context


AudioSource

Opaque audio asset reference obtained via context:audio(name). Pass to Audio.play() to produce an AudioSound.

See Also: Audio, AudioSound, Context


AudioSound

A playing audio instance returned by Audio.play() and related methods.

Attributes

AttributeTypeAccessDescription
volumenumberread/writePlayback volume

Methods

sound:stop()

Stops playback.

sound:stop()

sound:seek(seconds)

Seeks to a specific time in seconds.

sound:seek(seconds: number)

sound:seekFrame(frame)

Seeks to a specific frame.

sound:seekFrame(frame: number)

sound:completed()

Returns true if playback has finished.

sound:completed(): boolean

sound:time()

Returns current playback time in seconds.

sound:time(): number

sound:timeFrame()

Returns current playback time in frames.

sound:timeFrame(): number

See Also: Audio, AudioSource

Next Steps