Skip to content

KernelAPI reference

Class Tweener

Namespace: MicroEngine.Scenes
Assembly: MicroEngine.dll
Guide: Scenes

Simple value tweens driven by update time.

C#
public sealed class Tweener : IStateHashed

Inheritance

object ← Tweener

Implements

IStateHashed

Constructors

Tweener()

C#
public Tweener()

Properties

Count

Number of tweens playing or waiting for their delay.

C#
public int Count { get; }

Property Value

int

Methods

Add(float, Action<float>, Func<float, float>?, Action?, float)

Calls apply with eased progress 0..1 every update for duration seconds.

C#
public void Add(float duration, Action<float> apply, Func<float, float>? ease = null, Action? done = null, float delay = 0)

Parameters

duration float

apply Action<float>

ease Func<float, float>?

done Action?

delay float

Clear()

Removes every tween without applying its final value or calling its done callback.

C#
public void Clear()

HashState(StateHasher)

Adds the tweens’ state to the per-step state hash: for each tween, its duration, time played and delay left.

C#
public void HashState(StateHasher hash)

Parameters

hash StateHasher

Update(float)

Advances every tween by dt seconds and calls the done callback of those that ended. A scene calls this for its own Tweens.

C#
public void Update(float dt)

Parameters

dt float