Reference for the Mosaic class Effects::BoolEffect
Using the Change bool Effect to toggle between two bool values and animate a property with data type 'bool'.
The class Effects::BoolEffect provides an animation effect intended to toggle a 'bool' value between two values determined by the properties Value1 and value2. The effect can 'remote control' a 'bool' property which is referred by the Outlet property.
Beside the both end values, bool animation effects are determined by their duration. The duration is primarily controlled by the value of the property CycleDuration. This is the time the effect will take for a single animation run. Whether and how often the animation is repeated is stored in the property NoOfCycles. In this case the property InterCycleDelay can determine an optional interval to wait between two consecutive animation runs. Finally the property InitialDelay determines the interval to wait at the very beginning of the effect still before the first animation run began.
When the effect is finished a signal is send to the slot method stored in the OnFinished property.
Whether the effect is running or not is controlled by its property Enabled. It can be used to start and stop the effect. The effect can also be controlled by sending signals to its StartEffect and StopEffect slot methods.
property int32 CycleDuration = 1000;
The property 'CycleDuration' stores the period in milliseconds of a single animation run.
property bool Enabled = false;
The property 'Enabled' determines whether the effect is currently running.
Assigning the value 'true' to this property re-starts the effect. The effect will start then from the beginning.
property int32 InitialDelay = 0;
The property 'InitialDelay' stores the interval in milliseconds the effect should wait before the first animation run can begin. If InitialDelay is zero the effect will start the animation immediately.
property int32 InterCycleDelay = 1000;
The property 'InterCycleDelay' stores the interval in milliseconds the effect should wait between two consecutive animation runs. This value has no effect if the animation is not repeated. If InterCycleDelay is zero the effect will not wait between the animation runs.
property int32 NoOfCycles = 0;
The property 'NoOfCycles' determines how often the effect should repeat the animation. If this value is zero, the effect will run endless.
property slot OnFinished = null;
The property 'OnFinished' can refer to a slot method, which should be invoked when the effect is done. It's up to you to provide the slot method and to fill it with the desired behavior. It makes possible to chain effects together, so the finish of one effect can trigger another effect. To do this simply assign the StartEffect slot method of the one effect to the OnFinished property of the other effect.
property ^bool Outlet = null;
The property 'Outlet' can store a reference to a 'bool' property to modify at the runtime of the animation effect. To obtain a reference to a property, the Chora ^ Reference property operator should be used. See 'Chora User Manual'.
The slot method 'StartEffect' re-starts the effect if a signal is sent to this slot method. The effect will start from the beginning.
The slot method 'StopEffect' stops the running effect if a signal is sent to this slot method. This causes the animation to pause at its current position.
property bool Value1 = false;
The property 'Value1' determines the start value for the animation.
property bool Value2 = true;
The property 'Value2' determines the end value for the animation.