All examples · Sprites and 2D

Texture loading

What this example shows

useLoadTexture({ src, key }) hands back a texture immediately (status: 'loading') and fills it in when the image arrives. Every sprite here exists from the first frame: the renderer skips each one until its texture is ready, so they pop in as they land and nothing checks a status.

The bar underneath has no texture, which is exactly why it can draw while the rest is still coming, and useLoader is what tells it how far along it is.

Starting