Documentation ¶
Overview ¶
Package loadscreen implements a modal "Loading" screen for the game, which can be shown or hidden by gameplay scenes as needed.
Index ¶
Constants ¶
const ( ProgressWidth = 300 ProgressHeight = 16 )
Configuration values.
Variables ¶
This section is empty.
Functions ¶
func Hide ¶
func Hide()
Hide the loading screen.
NOTICE: the loadscreen is hidden on an async goroutine and it is NOT SAFE to clean up textures used by the wallpaper images, but this is OK because the loadscreen uses the same wallpaper every time and is called many times during gameplay, it can hold its textures.
func IsActive ¶
func IsActive() bool
IsActive returns whether the loading screen is currently visible.
func Loop ¶
Loop is called on every game loop. If the loadscreen is not active, nothing happens. Otherwise the loading screen UI is drawn to screen.
func PreloadAllChunkBitmaps ¶
PreloadAllChunkBitmaps is a helper function to eager cache all bitmap images of the chunks in a level drawing. It is designed to work with the loading screen and will set the Progress percent based on the total number of chunks vs. chunks remaining to pre-cache bitmaps from.
func SetProgress ¶
func SetProgress(v float64)
SetProgress sets the current progress value for loading screens having a progress bar.
func SetSubtitle ¶
func SetSubtitle(value ...string)
SetSubtitle specifies secondary text beneath the Loading banner. The subtitle is blanked on Show() and ShowWithProgress() and must be specified by the caller if desired. Pass multiple values for multiple lines of text.
func ShowWithProgress ¶
func ShowWithProgress()
ShowWithProgress initializes the loading screen with a progress bar starting at zero.
Types ¶
This section is empty.