By default RightJS comes with the basic visual effects package. It has one base (abstract) class Fx, which defines the common visual effects interface and is used as the basis for all the other effect classes.
Fx objects handle the following events:
In line with the general events handling convention this means that you can use all the common on, stopObserving etc methods as well as onStart, onFinish, onCancel shortcuts.
All visual effects support the following options:
|duration||‘normal’||the effect duration in ms or a string predefined name|
|transition||‘Sin’||the transition algorithm used for the effect|
|queue||true||boolean marker if the effect should be queued|
|engine||null||the engine used by Fx.Morph, defined automatically|
There are three named durations which an be used in Fx options:
|normal||400 ms (default)|
Since RightJS 2.3.0 the transition attribute can be defined via standard CSS3 cubic bezier functions.
cancel() -> Fx self
Cancels the effect and interrupts the visual effects queue.
finish() -> Fx self
Forces the effect to stop and marks it as a completely finished.
prepare([....]) -> void
Abstract method which gets called with the same arguments as the start method when the visual effects queue reaches this effect.
render(Float position) -> void
Abstract protected method where the actual effect rendering is supposed to happen. During the effect run it receives float numbers from 0 to 1 that represent the position of the effect from the beginning to the end.