application.on_scene_switch method

on_scene_switch(self, handler: Callable[[t: int], None]) -> Disposable:

Defines the onSceneSwitch handler which triggers before this scene changes to another.

Note: This method can be called multiple times to call additional functions on scene switch.

Parameters

  • handler: Callable[[t: int], None]

    function to call when scene switches. Provides an index parameter for the target scene

Returns