vegui. fx. class.jsSummary | | | | | | | | | | | | | | | | | | | Initializes the manager at the set interval, note that this does not start the interval timer, it just sets the speed. | | Activates the fx timer if any effects are currently active | | | | Adds an effect to a certain vegui element. | | a certain effect for the element with the submited element index | | This is the function that is repeatedly called by the fx timer. | | The base object for any effect | | | | | | | | | | Check if effect type exists in an array that collides with this array. | | | | | | fades the target element out, gradually reducing its transparency value to 0 | | | | | | | | | | | | | | | | | | fades the target element in, gradually increasing its transparency value to 100 | | | | | | | | | | | | | | | | | | Adds a shadow effect to a specified vegUI element | | | | | | | | | | | | | | | | | | | | | | Adds a scaling effect to a vegui element that lets it either grow into view or shrink out of view. | | | | | | | | | | | | executes/processes the effect | | |
Effect types| VUI_FX_FADEIN | fades the element in | | VUI_FX_FADEOUT | fades the element out | | VUI_FX_SHADOW | adds a shadow to the element | | VUI_FX_SCALE | grow or shrink an element |
VegUIFXManagerEffect manager Summary | | | | | | | | | Initializes the manager at the set interval, note that this does not start the interval timer, it just sets the speed. | | Activates the fx timer if any effects are currently active | | | | Adds an effect to a certain vegui element. | | a certain effect for the element with the submited element index | | This is the function that is repeatedly called by the fx timer. |
Object Properties| Timer | Interval , the fx interval | | interval | int, interval speed (ms) | | effectNum | int, number of active effects | | Effects | Array, holds active effects | | Manager | VegUIManager element that the fx manager belongs to |
VegUIFXManager| function VegUIFXManager( | Manager | ) |
|
constructor Parameters| VegUIManager Manager | VegUI manager object |
initializeInitializes the manager at the set interval, note that this does not start the interval timer, it just sets the speed. Paramters| int interval | fx timer interval (ms) |
Example FX.init(50);
startActivates the fx timer if any effects are currently active Returns| null | if Timer is already running | | int | 0, if no effects are queued |
See Alsostop
stopStops the fx timer Returns
effect_add| this.effect_add = function( | Element, | | Effect, | | onhalt | ) |
|
Adds an effect to a certain vegui element. Effects are added as objects Parameters| VegUIElement Element | the vegui element that the effect should hook on | | VegUIEffect Effect | the effect | | <function onhalt> | if submitted this function will be called when the effect is done |
Code exampleFX.effect_add(myNode, new VegUIFxFadeOut(2000));
Returns| VegUIEffect | the effect object |
effect_pop| this.effect_pop = function( | eleIdx, | | type | ) |
|
a certain effect for the element with the submited element index Parameters| int eleIdx | element index of the vegui element | | int type | effect type |
ExampleFX.effect_add(myNode, new VegUIFxFadeOut(2000));
FX.effect_pop(myNode.eleIdx, VUI_FX_FADEOUT);
pollThis is the function that is repeatedly called by the fx timer. It polls the Effects array for any active effects and executes them private function
VegUIEffectThe base object for any effect Summary | | | | | | | | | Check if effect type exists in an array that collides with this array. | | | | |
Object Properties| Element | VegUIElement, the element this effect is affecting | | type | int, effect type | | Manager | VegUIFXManager, FX manager that controls this effect | | isPassive | bool, if true the effect will be executed when it is created and will not be added to the processing loop of the fx engine |
collides| this.collides = function( | Effects, | | cancelOther | ) |
|
Check if effect type exists in an array that collides with this array. When effects collide it means that they can not be affecting the same target at the same time, and one will have to be canceled Parameters| Array effects | the array holding the effect objects | | bool cancelOther | if true the effect in the effects array will be canceled if false 1 will be returned |
Returns| int | 1 if there were coliding effects and cancelOther was false |
init| this.init = function( | Element, | | Manager | ) |
|
Initialize effect Parameters| VegUIElement Element | element this effect is affecting | | VegUIFXManager Manager | Manager that controls this effect |
halt_effect| this.halt = this.halt_effect = function( | noOnHalt | ) |
|
Aliashalt() Halts this effect, effectivly removing it Parameters| bool noOnHalt | if true <onhalt> will not be called |
VegUIFXFadeOutfades the target element out, gradually reducing its transparency value to 0
Hierarchyextends VegUIEffect Inherits all properties and methods from VegUIEffect
Example FX.effect_add(myNode, new VegUIFXFadeOut(1000));
FX.effect_add(myNode, new VegUIFXFadeOut(1000, 50));
Object Properties| fadeSpeed | int, speed of fading (ms) | | limit | int, effect will stop when this amount of transparency is reached |
VegUIFXFadeOut| function VegUIFXFadeOut( | fadeSpeed, | | limit | ) |
|
concstructor Parameters| int fadeSpeed | speed of fading (ms) | | int limit | effect will stopped when this amount of transparency is reached |
execute| this.execute = function() |
Execute effect
VegUIFXFadeInfades the target element in, gradually increasing its transparency value to 100
Hierarchyextends VegUIEffect Inherits all properties and methods from VegUIEffect
Example FX.effect_add(myNode, new VegUIFXFadeIn(1000));
FX.effect_add(myNode, new VegUIFXFadeIn(1000, 50));
Object Properties| fadeSpeed | int, speed of fading (ms) | | limit | int, effect will stop when this transparency value is reached |
VegUIFXFadeIn| function VegUIFXFadeIn( | fadeSpeed, | | limit | ) |
|
constructor Parameters| int fadeSpeed | speed of fading (ms) | | int limit | stop when limit is reached (min 0, max 100) |
execute| this.execute = function() |
Executes effect
VegUIFXShadowAdds a shadow effect to a specified vegUI element
Hierarchyextends VegUIEffect Inherits all properties and methods from VegUIEffect
Example FX.effect_add(myNode, new VegUIFXShadow(5,10,50,'#000');
Object Properties| x | int, x offset of the shadow | | y | int, y offset of the shadow | | opacity | int, the opacity of the outer shadow | | color | string, color of the shadow (css value) | | shadowNode | VegUINode, holds the shadow node |
VegUIFXShadow| function VegUIFXShadow( | x, | | y, | | opacity, | | color | ) |
|
execute| this.execute = function() |
executes effect
halt_fx_shadow| this.halt = this.halt_fx_shadow = function( | noOnHalt | ) |
|
Aliashalt() Parameters| <bool noOnHalt> | if true the onhalt event of the effect will not be fired |
See Also<VegUIEffect::halt>
VegUIFXScaleAdds a scaling effect to a vegui element that lets it either grow into view or shrink out of view. Summary | | | | | | | | | | | executes/processes the effect | | |
Example var StuntNode = Manager.get_new(VUI_NODE);
StuntNode.T.Css.border = '1px #fff solid'; Manager.build_element(StuntNode);
FX.effect_add(50,50,500,1,StuntNode,true,1000);
Object Properties| x | int, when growing the effect will start from here, when shrinking it will end here (x axis) | | y | int, when growing the effect will start from here, when shrinking it will end here (y axis) | | speed | int, scaling time (ms) | | StuntNodeTemplate | VegUIElement, template that will be used to clone the node that will be shown instead of the target element when unreasonable small sizes are reached | | StuntNode | VegUIElement, holds the built StuntNode element while the effect is active | | phase | int, the current phase of the effect | | scaleType | int, defines if the effect grows or shrinks the element (0 = grow, 1 = shrink) | | useFade | bool, if true the stunt node will be faded in/out as it moves | | fadeLimit | int, fade limit, if useFade is active fadeLimit prevents the fading past a certain value | | z | int, z index of the stunt node |
VegUIFXScale| function VegUIFXScale( | x, | | y, | | speed, | | scaleType, | | StuntNodeTemplate, | | useFade, | | z, | | fadeLimit | ) |
|
execute| this.execute = function() |
executes/processes the effect
halt_scale| this.halt_scale = this.halt = function() |
halts the event Aliashalt() See also<VegUIEffect::halt>
|