class Godot::TweenBuilder

Overview

Expressive builder wrapper around Godot::Tween

Defined in:

libgodot/extensions/tween.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

try?(&)
try?
try?

Constructor Detail

def self.new(tween : Tween, owner : Object | Nil = nil) #

Instance Method Detail

def animate(target : Object, prop : String | NodePath | Symbol, to val : Variant | Object | Int32 | Int64 | Float32 | Float64 | Bool | String | Vector2 | Vector3 | Vector4 | Color, duration : Float64 | ::Time::Span = 0.2, in in_duration : Float64 | ::Time::Span | Nil = nil, from from_val : Variant | Object | Int32 | Int64 | Float32 | Float64 | Bool | String | Vector2 | Vector3 | Vector4 | Color | Nil = nil, trans : Tween::TransitionType | Trans | Symbol | Int = :linear, ease : Tween::EaseType | Ease | Symbol | Int = :in_out) : PropertyTweenerStep #

Animates specified target property to destination value with optional transition, easing, and starting value


def animate(prop : String | NodePath | Symbol, to val : Variant | Object | Int32 | Int64 | Float32 | Float64 | Bool | String | Vector2 | Vector3 | Vector4 | Color, duration : Float64 | ::Time::Span = 0.2, in in_duration : Float64 | ::Time::Span | Nil = nil, from from_val : Variant | Object | Int32 | Int64 | Float32 | Float64 | Bool | String | Vector2 | Vector3 | Vector4 | Color | Nil = nil, trans : Tween::TransitionType | Trans | Symbol | Int = :linear, ease : Tween::EaseType | Ease | Symbol | Int = :in_out) : PropertyTweenerStep #

Animates owner node's property to destination value (target omitted)


def animate(prop : Symbol, sub_prop : Symbol, to val : Variant | Object | Int32 | Int64 | Float32 | Float64 | Bool | String | Vector2 | Vector3 | Vector4 | Color, duration : Float64 | ::Time::Span = 0.2, in in_duration : Float64 | ::Time::Span | Nil = nil, from from_val : Variant | Object | Int32 | Int64 | Float32 | Float64 | Bool | String | Vector2 | Vector3 | Vector4 | Color | Nil = nil, trans : Tween::TransitionType | Trans | Symbol | Int = :linear, ease : Tween::EaseType | Ease | Symbol | Int = :in_out) : PropertyTweenerStep #

Animates owner node's sub-property using symbols (e.g. animate :position, :y, to: 150.0)


def await_signal(sig : TypedSignal | SignalSubscription) : AwaitTweener #

Pauses until the given signal is emitted


def chain : self #

Calls Tween#chain and returns self


def chain(&block : TweenBuilder -> Void) : self #

Calls Tween#chain and yields self


def delay(duration : Float64 | ::Time::Span) : IntervalTweenerStep #

Delays the tween execution by the specified duration in seconds or ::Time::Span


def ease(type : Tween::EaseType | Ease | Symbol | Int) : self #

Sets default easing curve type on the tween


def kill : self #

Terminates the tween


def loops(count : Int = 0) : self #

Configures loop iterations (0 = infinite)


def owner : Object | Nil #

def parallel : self #

Calls Tween#parallel and returns self


def parallel(&block : TweenBuilder -> Void) : self #

Calls Tween#parallel and yields self


def pause : self #

Pauses the tween


def play : self #

Resumes the tween


def speed_scale(scale : Float64) : self #

Sets tween speed multiplier


def trans(type : Tween::TransitionType | Trans | Symbol | Int) : self #

Sets default transition type on the tween


def tween : Tween #