KernelAPI reference
Class Transition
Namespace: MicroEngine.Scenes
Assembly: MicroEngine.dll
Guide: Scenes
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).
public abstract class TransitionInheritance
Constructors
Transition(float)
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).
protected Transition(float duration)Parameters
duration float
Properties
Cover
0 = nothing covered, 1 = fully covered. While drawing, it follows the frame between the last two updates (FrameBlend), so the effect moves evenly on displays of any rate.
public float Cover { get; }Property Value
Duration
Length of the transition in seconds (at least 0.02).
public float Duration { get; }Property Value
Elapsed
Seconds played so far.
public float Elapsed { get; }Property Value
Finished
Whether the transition has played to the end.
public bool Finished { get; }Property Value
Progress
Elapsed time as a fraction of Duration, from 0 to 1. The scenes swap at 0.5.
public float Progress { get; }Property Value
Methods
Diamonds(float, Color?)
Growing diamonds sweep diagonally across the screen and shrink away.
public static Transition Diamonds(float duration = 0.7, Color? color = null)Parameters
duration float
Total length in seconds.
color Color?
Cover colour; null for black.
Returns
Draw(IRenderer)
Draws the effect over the scenes, using Cover.
public abstract void Draw(IRenderer renderer)Parameters
renderer IRenderer
Fade(float, Color?)
Fades to color (black by default) and back.
public static Transition Fade(float duration = 0.5, Color? color = null)Parameters
duration float
Total length in seconds.
color Color?
Cover colour; null for black.
Returns
Iris(Vector2, float, Color?)
A circle closes on center (virtual pixels) and opens again.
public static Transition Iris(Vector2 center, float duration = 0.8, Color? color = null)Parameters
center Vector2
Centre of the circle in virtual pixels.
duration float
Total length in seconds.
color Color?
Cover colour; null for black.
Returns
Wipe(float, Color?)
A panel slides in from the left, then leaves to the right.
public static Transition Wipe(float duration = 0.6, Color? color = null)Parameters
duration float
Total length in seconds.
color Color?
Cover colour; null for black.