Skip to content

Loading assets

samme edited this page Feb 26, 2021 · 23 revisions

Strategy

  • Load assets before using them
  • Load shared assets in a "boot" scene and nonshared assets in the scene they will be used in
  • Use a scene payload to load small assets before preload(), if needed
  • For special cases, run the scene loader manually

Assets

There are many types, and you can read about all of them.

The loader

Each scene has a loader plugin, this.load, for loading assets.

preload()

preload() is a special scene method that lets you queue files for loading. When preload() returns, if the scene loader has any files queued (added), it will start loading automatically and the scene create() method will be called only after loading is finished.

Clone this wiki locally