Skip to content

Loaders

Daniel Báez edited this page Sep 8, 2024 · 1 revision

KAPLAYGROUND perform some editions in the KAPLAY loader function to actually use the Asset manager assets.

For example, if you have in the tab Sprites a kat.png asset, you can import in KAPLAYGROUND using the following code:

loadSprite("assets/sprites/kat.png");

It works with any function that starts with load() and in their second parameter have a URL that match an asset. If there's not an asset for that url, the raw url is passed.

If your have a custom function that doesn't use load() at start, you can even get the transformed url using this comment:

// kaplay-transformation-asset
"assets/sprites/kat.png"
Clone this wiki locally