Assets
APIs for image assets and rendering options.
Image
Drawable image asset.
Attributes
| Attribute | Type | Description |
|---|---|---|
width | number | Width in pixels (read-only) |
height | number | Height in pixels (read-only) |
See Also: Renderer.drawImage
ImageFilter
Defines image sampling behavior during scaling or transformation.
Values
| Value | Description |
|---|---|
bilinear | Smooth filtering (default) |
nearest | Pixel-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
| Value | Description |
|---|---|
clamp | Clamps coordinates to [0, 1] range |
repeat | Tiles the texture by repeating |
mirror | Mirrors the texture at boundaries |
See Also: ImageSampler, Image
Blob
Binary data asset accessed via context:blob(name).
Attributes
| Attribute | Type | Description |
|---|---|---|
name | string | Asset name (read-only) |
size | number | Data size in bytes (read-only) |
data | buffer | Raw 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
| Attribute | Type | Access | Description |
|---|---|---|---|
volume | number | read/write | Playback 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
- Continue to Path Effects
- Need a refresher? Review Quick Reference