All examples · Text and UI

Fonts across scenes

What this example shows

One scene loads every font, the rest only name them. Loading calls useLoadFont with a key for each, shows the progress with useLoader, and moves on when it is done.

Title and Level never load anything: createText({ font: 'title' }) takes the font the game already holds under that key, instead of the font record. A key nobody loaded throws, naming it, rather than quietly drawing with another font.

Starting