Loading Screens#

The loadingscene feature provides base classes for loading screens. BaseLoadingScene and its children all work by listening to the asset system and when all known assets are loaded, continuing on.

class ppb.features.loadingscene.BaseLoadingScene(**kwargs)[source]#

Handles the basics of a loading screen.

get_progress_sprites()[source]#

Initialize the sprites in the scene, yielding the ones that should be tagged with progress.

Override me.

next_scene: ppb.Scene#

The scene to transition to when loading is complete. May be a type or an instance.

update_progress(progress)[source]#

Updates the scene with the load progress (0->1).

Override me.

class ppb.features.loadingscene.ProgressBarLoadingScene(**kwargs)[source]#

Assumes that a simple left-to-right progress bar composed of individual sprites is used.

Users should still override get_progress_sprites().

loaded_image: ppb.Image#

Image to use for sprites in the “loaded” state (left side)

unloaded_image: ppb.Image = None#

Image to use for sprites in the “unloaded” state (right side)

update_progress(progress)[source]#

Looks for sprites tagged progress and sets them to “loaded” or “unloaded” based on the progress.

The “progress bar” is assumed to be horizontal going from left to right.