Description:
Fades a scene object to a new color/alpha value
Fields:
Red/Green/Blue/Alpha (float) range 0 - 1 : The color/transparancy you want the behavior to fade to. If you specify a -1 (the default) that channel will be left unchanged.
Time (float) : The time in seconds for the fade to complete.
Increment (integer) : range 1 - 31 This will allow you to change the default stepping of the fade.
Pulse (bool) : If set, the object will contuinually fade between the original and faded values. Time is the time for 1/2 of the overall effect. Delete is inactive if pulse is enabled.
DeleteObject (bool) : If this is checked the object will be deleted when the fade completes.
Callback (bool) : If Callback is checked it will call the object::onFadeFinish() method.
Use:
To start a fade on the object call object.startFade(); This will start the fade process. If Pulse is enabled it will start automatically when the object is created.
Comments:
All values for the fade Behavior are stored in the behavior object. If you want to dynamically change the parameters you will need to change the field in the behavior attached to the object.
The fade is efficent in it only enables the onUpdate callback while actually fading. If you are using the pulse option, use in wisely. The onupdate is being called every 32ms for each object with pulse enabled and over use of pulse could cause performance issues.
Not Implemented:
Validation - it is assumed you know what color/alpha values you desire and no checking is done to validate them.
Additional methods for dynamic control of the behavior.