Skip to content

Tween

namespace Griff.Runtime;
public sealed class Tween

A value animated over time, made with Tween or a behavior’s MoveTo, ScaleTo, RotateTo and FadeTo. Tweens run on game time, so they slow down with Scale and stop while the game is paused.

public float Duration { get; }

Seconds from start to finish.

public bool IsActive { get; }

False once the tween has finished or was cancelled.

public Entity? Owner { get; }

The entity whose removal cancels this tween, if any.

public void Cancel()

Stops the tween where it is. Its Then action doesn’t run.

public Tween Then(Action action)

Runs action when the tween finishes (not if it’s cancelled). Start another tween from it to chain them. Returns this tween.