Skip to main content

Asset

The Asset type represents an asset file such as an image or sound. Assets can be specified using a @ symbol followed by the filename. If there are multiple files with the same filename, the file which is closest to the current file will be selected.

// Refer to assets by their filename with an @ prefix before the string
// This will be resolved at compile time and will error at compile time if it does not exist
Image(@fireball.svg) // displays the image in the UI
ImageSprite(@fireball.svg) // renders the image as a sprite in-game

Sing(@fireball.esfx) // plays the sound but stops if this entity dies
Hear(@fireball.esfx) // plays the sound to completion