KernelAPI reference
Namespace MicroEngine.Scenes
The scene stack (scenes, transitions, coroutines and tweens) and the scene world: entity ids, transforms with a hierarchy, typed attachments, interpolation for drawing and world clocks.
Guide: Scenes
Classes
Controls a coroutine started with Start.
Runs iterator-based sequences one step per update. A coroutine may yield null (next update), Seconds, Until or another IEnumerator (awaited as a sub-routine). Ideal for cutscenes, dialogue flow and timed effects without hand-written state machines.
Scene<TResult>
A scene that ends by returning a value to whoever pushed it (a dialogue’s choice, a shop’s purchase, a menu’s answer): push it with Push``1 and end it with Finish.
Manages the scene stack and the transitions between scenes.
The engine’s IWorld: entity slots with generations, local and step-start transforms, a parent/child tree, and one dense array per attachment type. Games program against IWorld; whoever owns the world (its scene) calls BeginStep before the world’s step, EndStep after it and BeginDraw before drawing it.
A screen of the game (title, level, battle, pause menu…). Scenes live on a stack: an overlay scene (dialogue, pause) draws on top of the scene below and can freeze it. Each scene owns its coroutines and tweens, which stop when it leaves the stack.
A full-screen effect that covers the old scene (progress 0..0.5), swaps scenes at 0.5 and reveals the new one (0.5..1). Subclasses draw a cover amount between 0 (clear) and 1 (covered).
Simple value tweens driven by update time.
Yield instruction that pauses a coroutine for a number of seconds; create it with Seconds.
Yield instruction that pauses a coroutine until a condition holds; create it with Until.
Yield instructions understood by CoroutineRunner.
A world’s own time: a time scale and freezes (hitstop) on top of the engine’s fixed step. It advances as part of its world’s step (BeginStep), once per step: a world that does not step (paused, under an overlay) consumes no time and no freeze.
Structs
Attachments<T>.Enumerator
Walks the attachments; allocates nothing.
Attachments<T>
The attachments of type T of live entities, in attach order (All``1).
Walks the children; allocates nothing.
The live direct children of an entity, in parenting order (Children).
An entity of an IWorld: a slot index and the generation of the entity that held the slot when the id
was made. A destroyed entity’s slot is reused with a new generation, so an old id never reaches the new entity.
default is None (generation 0 is never issued).
Position, rotation and scale relative to the parent (or to the world for a root entity). Stored in 3D; 2D games use
the 2D helpers, which read and write X/Y and the rotation about Z. default is degenerate (zero scale and
a zero quaternion): entities start at Identity.
Interfaces
An attachment told when its entity is released (at the end of the step its entity was destroyed in).
The objects of a scene: entities with an id, a transform (with an optional parent) and typed attachments. The world runs no game logic: it stores, identifies, orders, interpolates and destroys. Game code programs against this interface; the scene that owns the world drives its step and draw hooks (SceneWorld).