ctrlSetAngle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_this" to "_this")
m (Text replacement - " <!-- [A-Z]+ Notes? Section -->" to "")
Line 65: Line 65:


<dl class='command_description'>
<dl class='command_description'>
<!-- BEGIN Note Section -->
<!-- For example:
<!-- For example:
<dd class='notedate'>Posted on Month Day, Year - Time (UTC)</dd>
<dd class='notedate'>Posted on Month Day, Year - Time (UTC)</dd>
Line 72: Line 71:
<code>[[if]] ([[Magic Variables#this|_this]] == anExample) [[then]] { hint: Leave it here for others to read; };</code></dd>
<code>[[if]] ([[Magic Variables#this|_this]] == anExample) [[then]] { hint: Leave it here for others to read; };</code></dd>
-->
-->
<!-- END Note Section -->
</dl>
</dl>



Revision as of 01:59, 6 April 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
GUI Control

Syntax

Syntax:
Syntax needed
Parameters:
control: Control - picture control
[angle, centerX, centerY]: Array
angle: Number - Rotation angle (clockwise)
centerX: Number - Rotation center X in range 0 to 1 (0.5 - control center)
centerY: Number - Rotation center Y in range 0 to 1 (0.5 - control center)
Return Value:
Return value needed

Alternative Syntax

Syntax:
control ctrlSetAngle [angle, centerX, centerY, now] Template:Since
Parameters:
control: Control - picture control
[angle, centerX, centerY]: Array
angle: Number - Rotation angle (clockwise)
centerX: Number - Rotation center X in range 0 to 1 (0.5 - control center)
centerY: Number - Rotation center Y in range 0 to 1 (0.5 - control center)
now: Boolean - (Optional, default true) if false, control will wait for ctrlCommit input for result to apply
Return Value:
Nothing

Examples

Example 1:
_control ctrlSetAngle [25, 0.5, 0.5];
Example 2:
with uiNamespace do { ctrl = findDisplay 46 ctrlCreate ["RscPictureKeepAspect", -1]; ctrl ctrlSetPosition [0,0,1,1]; ctrl ctrlSetText "A3\Missions_F_Exp\data\Img\lobby\ui_campaign_lobby_background_tablet_radial_left_ca.paa"; ctrl ctrlCommit 0; angle = 0; onEachFrame { with uiNamespace do { if (angle > 359) then {angle = 0}; ctrl ctrlSetAngle [angle, 0.5, 0.5]; angle = angle + 1; }; }; };
Example 3:
_control ctrlSetAngle [25, 0.5, 0.5, false]; _control ctrlCommit 1; // Rotation applies smoothly for 1 second.

Additional Information

See also:
ctrlAngle

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