Panel/AlphaTo

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Func |Name=AlphaTo |Parent=Panel |Description=Transitions the current alpha of a panel, to the new alpha over a set period of time after a specified delay. |Realm=Client...")
 
(Wording, added info.)
Line 2: Line 2:
 
|Name=AlphaTo
 
|Name=AlphaTo
 
|Parent=Panel
 
|Parent=Panel
|Description=Transitions the current alpha of a panel, to the new alpha over a set period of time after a specified delay.
+
|Description=Uses animation to transition the current alpha value of a panel to a new alpha, over a set period of time and after a specified delay.
 
|Realm=Client
 
|Realm=Client
 
|IsClass=Yes
 
|IsClass=Yes
Line 9: Line 9:
 
|type=number
 
|type=number
 
|name=alpha
 
|name=alpha
|desc=The alpha to approach
+
|desc=The alpha value (0-255) to approach.
 
}}
 
}}
 
{{Arg
 
{{Arg
 
|type=number
 
|type=number
 
|name=duration
 
|name=duration
|desc=How long time it should take to reach the alpha
+
|desc=The time in seconds it should take to reach the alpha.
 
}}
 
}}
 
{{Arg
 
{{Arg
 
|type=number
 
|type=number
 
|name=delay
 
|name=delay
|desc=How long it should take before it starts to approach the alpha
+
|desc=The delay before the animation starts.
 +
|default=0
 
}}
 
}}
 
{{Arg
 
{{Arg
 
|type=function
 
|type=function
|name=finished
+
|name=callback
|desc=The function that is called when it has reached the alpha
+
|desc=The function to be called once the animation finishes. Arguments are:
 +
* {{FuncArg|table|animData|The {{Struct|AnimationData}} that was used.}}
 +
* {{FuncArg|Panel|pnl|The panel object that was moved.}}
 
}}
 
}}

Revision as of 20:41, 1 December 2014

 Panel:AlphaTo( )

Contents

Description

Uses animation to transition the current alpha value of a panel to a new alpha, over a set period of time and after a specified delay.

Arguments

number alpha

The alpha value (0-255) to approach.

Arguments

number duration

The time in seconds it should take to reach the alpha.

Arguments

number delay=0

The delay before the animation starts.

Arguments

function callback

The function to be called once the animation finishes. Arguments are:

Personal tools
Navigation