LoadingScreen

Drawn over the game while a scene is loading (see GameScene.onLoad()). Extend it and override draw() for your own loading screen, then return it from GameScene.getLoadingScreen() or set it as game.loadingScreen.

It's drawn on the UI canvas, above the game UI and the fade overlay, below the debug UI.

Properties

  • showAfterSeconds (float) — Loads that finish sooner than this never show the screen, so fast loads don't flash

Constructor

new LoadingScreen(): LoadingScreen

Instance Methods

onShow(): void

Called when the screen first appears.

Returns

  • void

onHide(): void

Called when loading finishes, just before the new scene's onCreate().

Returns

  • void

draw(renderer: BGE.Renderer, progress: float, dt: float): void

Draws one frame of the loading screen.

Parameters

  • renderer (BGE.Renderer) — the UI canvas renderer
  • progress (float) — overall load progress, 0 to 1
  • dt (float) — seconds since the last frame, for animation

Returns

  • void