ctrlSetFade: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(framerate dependancy)
(added extra helpful informative feature about using "fade = 1" inside a control's config.)
 
(49 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1
|version1= 1.00


|1.00|= Game version
|game2= arma2
____________________________________________________________________________________________
|version2= 1.00


| Sets wanted transparency for control animation. Requires [[ctrlCommit]] to commit changes. |= Description
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| controlName '''ctrlSetFade''' fade |= Syntax
|game4= tkoh
|version4= 1.00


|p1= controlName: [[Control]] |= Parameter 1
|game5= arma3
|version5= 0.50


|p2= fade: [[Number]] |= Parameter 2
|gr1= GUI Control


| [[Nothing]] |= Return value
|descr= Sets wanted transparency for control animation. Requires [[ctrlCommit]] to commit changes. To hide or show a control instantly, use [[ctrlShow]].
____________________________________________________________________________________________
{{ Feature | Informative | Despite having <syntaxhighlight lang="cpp" inline>fade = 1;</syntaxhighlight> inside a control's config, <sqf inline>ctrlFade</sqf> will '''still report a fade of 0'''.<br>
 
Which results in <sqf inline>ctrlSetFade 0</sqf> '''doing nothing in that situation'''.<br>
|x1= <code>_control [[ctrlSetFade]] 1;
To counter that, first use <sqf inline>ctrlSetFade 1</sqf>, then <sqf inline>ctrlCommit 0</sqf> ( to instantly apply it ), and then you can use [[ctrlSetFade]] to set the fade to any value you wish.}}
_control [[ctrlCommit]] 5;</code> |= Example 1
|s1= controlName [[ctrlSetFade]] fade
____________________________________________________________________________________________


| [[ctrlFade]], [[cutFadeOut]], [[ctrlCommit]] |= See also
|p1= controlName: [[Control]]


}}
|p2= fade: [[Number]]


<h3 style="display:none">Notes</h3>
|r1= [[Nothing]]
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x1= <sqf>_control ctrlSetFade 1;
</dl>
_control ctrlCommit 5;</sqf>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[ctrlFade]] [[cutFadeOut]] [[ctrlCommit]]
}}


[[Category:Scripting Commands|CTRLSETFADE]]
{{Note
[[Category:Scripting Commands ArmA|CTRLSETFADE]]
|user= Nelis.75733126
[[Category:Command_Group:_GUI_Control|{{uc:{{PAGENAME}}}}]]
|timestamp= 20240416211007
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
|text= Unfortunately, in Arma 3 2.17, when <sqf inline>ctrlSetFade</sqf> is used on a CtrlToolbox or RscToolbox, it only has effect on the text of it.
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on March 10, 2015 - 02:02 (UTC)</dd>
<dt class="note">[[User:Feint|Feint]]</dt>
<dd class="note">
This command sets the amount of fade. For example:
<code>
_ctrl ctrlSetFade 1; // hides the control<br>
_ctrl ctrlSetFade 0.5; // control is 50% visible<br>
_ctrl ctrlSetFade 0; // control is fully visible
</code>
</dd>
</dl>
<dl class="command_description">
<dd class="notedate">Posted on August 28, 2017 - 11:33 (UTC)</dd>
<dt class="note">[[User:Demellion|Demellion]]</dt>
<dd class="note">
The resulting fade speed seems like is not exactly what [[ctrlCommit]] commands it to be, as is dependant on your current framerate. Example:
<code>_ctrl ctrlSetFade 0.5;
_ctrl ctrlCommit 1;
</code>
Will actually result in:
<code>'''[60 FPS and higher]''' = ~1.0 seconds
'''[30 FPS and around]''' = ~1.2 seconds
'''[10 FPS and anything lower]''' = ~5-10 seconds
</code>
This phenomenon probably occurs because of engine time simulation disruption caused by performance damage.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 15:13, 21 April 2024

Hover & click on the images for description

Description

Description:
Sets wanted transparency for control animation. Requires ctrlCommit to commit changes. To hide or show a control instantly, use ctrlShow.
Despite having fade = 1; inside a control's config, ctrlFade will still report a fade of 0.

Which results in ctrlSetFade 0 doing nothing in that situation.

To counter that, first use ctrlSetFade 1, then ctrlCommit 0 ( to instantly apply it ), and then you can use ctrlSetFade to set the fade to any value you wish.
Groups:
GUI Control

Syntax

Syntax:
controlName ctrlSetFade fade
Parameters:
controlName: Control
fade: Number
Return Value:
Nothing

Examples

Example 1:
_control ctrlSetFade 1; _control ctrlCommit 5;

Additional Information

See also:
ctrlFade cutFadeOut ctrlCommit

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Nelis.75733126 - c
Posted on Apr 16, 2024 - 21:10 (UTC)
Unfortunately, in Arma 3 2.17, when ctrlSetFade is used on a CtrlToolbox or RscToolbox, it only has effect on the text of it.