KernelAPI reference
Class SceneManager
Namespace: MicroEngine.Scenes
Assembly: MicroEngine.dll
Guide: Scenes
Manages the scene stack and the transitions between scenes.
public sealed class SceneManagerInheritance
Properties
Count
Number of scenes on the stack.
public int Count { get; }Property Value
Current
The top scene, or null when the stack is empty.
public Scene? Current { get; }Property Value
InTransition
Whether a transition is playing.
public bool InTransition { get; }Property Value
Stack
The scenes from bottom (index 0) to top.
public IReadOnlyList<Scene> Stack { get; }Property Value
Methods
Pop(Transition?)
Removes the top scene, deferred like Push. The scene below receives Resume. Does nothing on an empty stack.
public void Pop(Transition? transition = null)Parameters
transition Transition?
Push(Scene, Transition?)
Puts scene on top of the stack. The change is deferred: it applies before the next update (or
after Game’s Load), or halfway through transition when one is given.
public void Push(Scene scene, Transition? transition = null)Parameters
scene Scene
transition Transition?
Remarks
Changes keep the order they were requested in. A change requested while a transition plays drops its own transition; until the playing transition has swapped its scenes, it waits and applies right after the swap.
Push<TResult>(Scene<TResult>, Action<TResult>, Transition?)
Pushes a scene that returns a value, deferred like Push: when it calls
Finish, it is popped and onResult receives the value (after the
scene’s Exit, before the scene below receives Resume).
public void Push<TResult>(Scene<TResult> scene, Action<TResult> onResult, Transition? transition = null)Parameters
scene Scene<TResult>
onResult Action<TResult>
transition Transition?
Type Parameters
TResult
Replace(Scene, Transition?)
Replaces the top scene.
public void Replace(Scene scene, Transition? transition = null)Parameters
scene Scene
transition Transition?
Reset(Scene, Transition?)
Clears the stack and starts over with scene.
public void Reset(Scene scene, Transition? transition = null)Parameters
scene Scene
transition Transition?