Page 1 of 1

Opacity SetObject from Variable

PostPosted: Thu Apr 21, 2016 8:34 am
by TinTin
Hi all,

Trying to change opacity of object at runtime.. not proving that easy. Any help appreciated.


.// Initial Colour Needed! (Brightness Level)
HideObject "Box" "" 0
SetObjectStyle "Box" "background-color" "#FF00FF"

RandomEx 1 10 [Random]
Math "[Random]/10" -1 [RandomBrightness]

SetObjectStyle "Box" "opacity" "[RandomBrightness]"

ShowObject "Box" "" 0

Re: Opacity SetObject from Variable

PostPosted: Thu Apr 21, 2016 6:31 pm
by Neosoft Support
Change the second parameter in the Math action from -1 to 2. For example:

RandomEx 1 10 [Random]
Math "[Random]/10" 2 [RandomBrightness]
SetObjectStyle "Box" "opacity" "[RandomBrightness]"

Using -1 will round the result of the calculation which isn't what you want. Opacity must be a value between 0.0 and 1.0. Example: 0.5 would be 50% opacity.