Skip to content

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).

C#
public abstract class Transition

Inheritance

object ← Transition

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).

C#
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.

C#
public float Cover { get; }

Property Value

float

Duration

Length of the transition in seconds (at least 0.02).

C#
public float Duration { get; }

Property Value

float

Elapsed

Seconds played so far.

C#
public float Elapsed { get; }

Property Value

float

Finished

Whether the transition has played to the end.

C#
public bool Finished { get; }

Property Value

bool

Progress

Elapsed time as a fraction of Duration, from 0 to 1. The scenes swap at 0.5.

C#
public float Progress { get; }

Property Value

float

Methods

Diamonds(float, Color?)

Growing diamonds sweep diagonally across the screen and shrink away.

C#
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

Transition

Draw(IRenderer)

Draws the effect over the scenes, using Cover.

C#
public abstract void Draw(IRenderer renderer)

Parameters

renderer IRenderer

Fade(float, Color?)

Fades to color (black by default) and back.

C#
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

Transition

Iris(Vector2, float, Color?)

A circle closes on center (virtual pixels) and opens again.

C#
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

Transition

Wipe(float, Color?)

A panel slides in from the left, then leaves to the right.

C#
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.

Returns

Transition