addScene

inline suspend fun <Type : SceneType> addScene(scene: Type)
open suspend fun <Type : SceneType> addScene(type: KClass<Type>, scene: Type)

Registers an instance of Scene.

See also

Parameters

Type

concrete class of the Scene instance. The implementation assumes that scenes are singletons and only one implementation of each class will be registered.

scene

instance of Type. After invocation of this method, setScene can be used with the appropriate class to change current screen to this object.

Throws

if a scene of selected type is already registered. Use removeScene first to replace the screen.