This example demonstrates UIProgress elements for creating dynamic progress bars and health indicators. A health bar is positioned above the character showing real-time progress updates, along with all previous UI elements and a vignette overlay.
// Create progress bar
const bar = new UIProgress(
layer,
textureForeground,
{
textureBackground, // Optional
progress: 0.75, // Initial progress value
foregroundColor: 0xe26a36,
backgroundColor: 0xe26a36,
},
);