SetUIFloatGradual

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Gradually changes the value of the specified UI component trait, first setting it to startValue, then gradually increases/decreases it toward endValue, in duration seconds (unaffected by Time Mult (GetGlobalTimeMultiplier)).

This enables creating simple animations using UI tiles.

  • The 1st argument componentPath should be of the format "MenuName\TileName\...\TraitName", as defined in the XML hierarchy for the particular menu.
  • The last (5th) argument changeMode is optional, and may be used to toggle "special" change modes, as follows:
0	(Default) From startVal to endVal in duration.
1	From startVal to endVal in duration/6, endVal for duration*2/3, back to startVal in duration/6.
2	From startVal to endVal back to startVal, in duration, repeated perpetually.
3	From startVal to endVal, in duration, repeated perpetually.

Syntax

[help]
SetUIFloatGradual componentPath:string startValue:float endValue:float duration:float changeMode:int{0-3}

Example

SetUIFloatGradual "HUDMainMenu\Example_Tile\width" 200 50 4

Sets the width trait to 200; gradually decreases it to 50 over 4 seconds.

SetUIFloatGradual "ContainerMenu\Example_Tile\alpha" 0 255 6 1

Sets the alpha trait to 0; gradually increases to 255 over 1 second; remains at 255 for 4 seconds; gradually decreases to 0 over 1 second.

SetUIFloatGradual "RecipeMenu\Example_Tile\alpha" 0 255 4 2

Sets the alpha trait to 0; gradually increases to 255, then gradually back to 0, over a total of 4 seconds; repeats perpetually.

SetUIFloatGradual "LockpickMenu\Example_Tile\rotateangle" 0 6.2831853 5 3

Sets the rotateangle trait to 0; gradually increases to over 5 second; repeats perpetually.



When using modes 2 or 3 (both of which repeat perpetually), in order to stop the animation, call the function again while omitting all but 1st argument componentPath:

SetUIFloatGradual "RecipeMenu\Example_Tile\alpha"

Alternatively, do include the 2nd argument startValue, in which case in addition to stopping the animation, the trait will also be set to that value:

SetUIFloatGradual "LockpickMenu\Example_Tile\rotateangle" 0

See Also