class Adw::TimedAnimation

Overview

A time-based #Animation.

Adw::TimedAnimation implements a simple animation interpolating the given value from [property@TimedAnimation:value-from] to [property@TimedAnimation:value-to] over TimedAnimation::duration milliseconds using the curve described by TimedAnimation::easing.

If TimedAnimation::reverse is set to TRUE, Adw::TimedAnimation will instead animate from [property@TimedAnimation:value-to] to [property@TimedAnimation:value-from], and the easing curve will be inverted.

The animation can repeat a certain amount of times, or endlessly, depending on the [property@TimedAnimation:repeat-count] value. If TimedAnimation::alternate is set to TRUE, it will also change the direction every other iteration.

Defined in:

lib/gi-crystal/src/auto/adw-1/timed_animation.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Adw::Animation

done_signal done_signal, pause : Nil pause, play : Nil play, reset : Nil reset, resume : Nil resume, skip : Nil skip, state : Adw::AnimationState state, target : Adw::AnimationTarget target, target=(target : Adw::AnimationTarget) : Nil target=, value : Float64 value, widget : Gtk::Widget widget, widget=(value : Gtk::Widget?) : Gtk::Widget? widget=

Constructor methods inherited from class Adw::Animation

new
new(*, state : Adw::AnimationState? = nil, target : Adw::AnimationTarget? = nil, value : Float64? = nil, widget : Gtk::Widget? = nil)
new

Class methods inherited from class Adw::Animation

g_type : UInt64 g_type

Instance methods inherited from class GObject::Object

bind_property(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags) : GObject::Binding bind_property, bind_property_full(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags, transform_to : GObject::Closure, transform_from : GObject::Closure) : GObject::Binding bind_property_full, data(key : String) : Pointer(Void)? data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, notify(property_name : String) : Nil notify, notify_by_pspec(pspec : GObject::ParamSpec) : Nil notify_by_pspec, notify_signal notify_signal, property(property_name : String, value : _) : Nil property, qdata(quark : UInt32) : Pointer(Void)? qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void)?) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void)? steal_data, steal_qdata(quark : UInt32) : Pointer(Void)? steal_qdata, thaw_notify : Nil thaw_notify, to_unsafe : Pointer(Void) to_unsafe, watch_closure(closure : GObject::Closure) : Nil watch_closure

Constructor methods inherited from class GObject::Object

cast(obj : GObject::Object) : self cast, cast?(obj : GObject::Object) : self? cast?, new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
new
new
, newv(object_type : UInt64, parameters : Enumerable(GObject::Parameter)) : self newv

Class methods inherited from class GObject::Object

compat_control(what : UInt64, data : Pointer(Void)?) : UInt64 compat_control, g_type : UInt64 g_type, interface_find_property(g_iface : GObject::TypeInterface, property_name : String) : GObject::ParamSpec interface_find_property, interface_list_properties(g_iface : GObject::TypeInterface) : Enumerable(GObject::ParamSpec) interface_list_properties

Constructor Detail

def self.new(widget : Gtk::Widget, from : Float64, to : Float64, duration : UInt32, target : Adw::AnimationTarget) : self #

Creates a new Adw::TimedAnimation on @widget to animate @target from @from to @to.


def self.new #

Initialize a new TimedAnimation.


def self.new(*, alternate : Bool? = nil, duration : UInt32? = nil, easing : Adw::Easing? = nil, repeat_count : UInt32? = nil, reverse : Bool? = nil, state : Adw::AnimationState? = nil, target : Adw::AnimationTarget? = nil, value : Float64? = nil, value_from : Float64? = nil, value_to : Float64? = nil, widget : Gtk::Widget? = nil) #

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


Instance Method Detail

def alternate : Bool #

Gets whether @self changes direction on every iteration.


def alternate=(alternate : Bool) : Nil #

Sets whether @self changes direction on every iteration.


def alternate? : Bool #

def duration : UInt32 #

Gets the duration of @self.


def duration=(duration : UInt32) : Nil #

Sets the duration of @self.

If the animation repeats more than once, sets the duration of one iteration.


def easing : Adw::Easing #

Gets the easing function @self uses.


def easing=(easing : Adw::Easing) : Nil #

Sets the easing function @self will use.

See #Easing for the description of specific easing functions.


def repeat_count : UInt32 #

Gets the number of times @self will play.


def repeat_count=(repeat_count : UInt32) : Nil #

Sets the number of times @self will play.

If set to 0, @self will repeat endlessly.


def reverse : Bool #

Gets whether @self plays backwards.


def reverse=(reverse : Bool) : Nil #

Sets whether @self plays backwards.


def reverse? : Bool #

def value_from : Float64 #

Gets the value @self will animate from.


def value_from=(value : Float64) : Nil #

Sets the value @self will animate from.

The animation will start at this value and end at [property@TimedAnimation:value-to].

If TimedAnimation::reverse is TRUE, the animation will end at this value instead.


def value_to : Float64 #

Gets the value @self will animate to.


def value_to=(value : Float64) : Nil #

Sets the value @self will animate to.

The animation will start at [property@TimedAnimation:value-from] and end at this value.

If TimedAnimation::reverse is TRUE, the animation will start at this value instead.