Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
LoadingAnim Interface Reference

Interface for classes implementing animation or progress bar of the loading screen. More...

Inheritance diagram for LoadingAnim:
[legend]

Public Member Functions

void LoadingAnim (WorkspaceWidget workspaceWidget)
 
void Show ()
 Called just before loading animation is shown.
 
void Update (float timeSlice, float progress, float minDurationRatio)
 Used for updating the loading screen animations and progress bars.
 
void Hide ()
 Called when loading animation has finished and should be hidden.
 

Public Attributes

WorkspaceWidget m_WorkspaceWidget
 

Detailed Description

Interface for classes implementing animation or progress bar of the loading screen.

To customize the implementation, override Game::CreateLoadingAnim() function to return your own implementation of LoadingAnim. You should perform any expensive setup, such as loading UI layout, in the constructor to avoid freezes due to loading of resources when game shows the loading screen.

Warning
Loading and initialization of resources are done asynchronously. It is generally safe to access only types related to WorkspaceWidget stored in LoadingAnim (such as child widgets loaded using this WorkspaceWidget) and other variables that cannot be changed from somewhere else (such as local variables and member variables that are primitive types).

Constructor & Destructor Documentation

◆ LoadingAnim()

void LoadingAnim.LoadingAnim ( WorkspaceWidget  workspaceWidget)

Member Function Documentation

◆ Hide()

void LoadingAnim.Hide ( )

Called when loading animation has finished and should be hidden.

Warning
This function is called concurrently with loading and initialization of resources (including scripted entities and components). Do not access anything that may be modified from somewhere else.

Implemented in BaseLoadingAnim.

◆ Show()

void LoadingAnim.Show ( )

Called just before loading animation is shown.

You shouldn't perform any expensive operations here (such as loading images and UI layouts) to avoid freezes when loading screen is shown.

Warning
This function is called concurrently with loading and initialization of resources (including scripted entities and components). Do not access anything that may be modified from somewhere else.

Implemented in BaseLoadingAnim.

◆ Update()

void LoadingAnim.Update ( float  timeSlice,
float  progress,
float  minDurationRatio 
)

Used for updating the loading screen animations and progress bars.

Progress value is based on how many resources are still left in loading queue. However, loading new resources can cause more things to be added to the queue, so this value can jump up and down and these cases need to be handled, otherwise progress may appear to go backwards.

Some platforms require that loading screen is visible for at least certain minimum amount of time. To account for this, minDurationRatio provides percentage of this minimum duration that has already elapsed.

Warning
This function is called concurrently with loading and initialization of resources (including scripted entities and components). Do not access anything that may be modified somewhere else.
Parameters
timeSliceTime slice in seconds.
progressUnmodified loading progress value between 0 and 1. This value may decrease.
minDurationRatioRatio of minimal duration that has already elapsed, between 0 and 1. This value never decreases.

Implemented in BaseLoadingAnim.

Member Data Documentation

◆ m_WorkspaceWidget

WorkspaceWidget LoadingAnim.m_WorkspaceWidget

The documentation for this interface was generated from the following file: