All examples · Sprites and 2D

Camera and HUD

What this example shows

One scene, two spaces. A trailing camera chases the player, so the player swings across the screen while the grid scrolls.

The HUD calls useScreenSpace(), which pins it and everything created under it to the screen: the bar and the badge stay nailed to the canvas however the camera moves, and one call covers all of them. The other way to get a fixed HUD is a scene of its own started with useScene().launch().

Starting