Class
PhocPropertyEaser
Description [src]
final class Phoc.PropertyEaser : GObject.Object
{
/* No available fields */
}
Eases properties of a given object.
Based on the given easing function the PhocPropertyEaser
will
ease the specified float
properties of the target
object based
on the progress set via progress
across the unit interval [0.0,
1.0]
.
If an object has properties a
and b
that should be eased in the intervals [-1.0,1.0]
and [10.0, 100.0]
respectively the invocation would look like:
PhocPropertyEaser easer = phoc_property_easer_new (G_OBJECT (object));
phoc_property_easer_set_props (easer, "a", -1.0, 1.0, "b", 0.0, 100.0, NULL);
which sets up the properties to their initial values. Changing progress
then
updates the properties according to the given easing function. E.g. with PHOC_EASING_NONE
(plain linear interpolation)
phoc_property_easer_set_progress (easer, 0.5);
would set object.a == 0.0
and object.b == 50.0
.
The eased properties must be of type float
or int
. If the tracked object goes away the
easing stops. No ref is held on the object.
Instance methods
phoc_property_easer_set_progress
Sets the current progress and updates the target objects properties according to the set easing function.