|
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
|
An asset is a file your game uses: an image, a font, a scene, an animation.
Drag the file onto the Asset Browser, or copy it into the project's assets folder. The editor imports it on its own.
| File | Becomes |
|---|---|
| .png | An image. See Sprites |
| .ttf, .bdf | A font. See Text |
| .scene | A scene |
| .anim | An animation. See Animation |
Beside each asset is a file of the same name ending in .data. It holds the asset's settings and its id, and fields point at that id. Move and rename assets in the Asset Browser, so the two stay together and nothing that uses them breaks.
Choose it in the Inspector. A field like Sprite or Font offers the assets of that kind.
For your own components, add a field:
Use it like a pointer. The asset loads the first time your code needs it.
An image's settings can differ per device, such as a smaller Max Size where memory is short: see Sprites. Each device's build gets its own copy, so your other targets are not affected.
The Memory panel shows what a scene will take on a device before you run it.
How assets are stored and found is covered under Working on Deki, in Asset System.