ctrlSetAngle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <!-- [A-Z]+ Notes? Section -->" to "")
(merged syntaxes)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command
|arma3
|1.62
|arg=
|eff=


|gr1= GUI Control
|game1= arma3


| Sets the rotation of an <tt>ST_PICTURE</tt> control. Rotation will be done within the control boundaries, so if the X and Y are given off center, the picture may get clipped by the control boundaries. Doesn't require [[ctrlCommit]]. Procedural textures filled controls do not rotate.
|version1= 1.62
| control [[ctrlSetAngle]] [angle, centerX, centerY]


|p1= control: [[Control]] - picture control
|arg= local


|p2= [angle, centerX, centerY]: [[Array]]
|eff= local


|p3= angle: [[Number]] - Rotation angle (clockwise)
|gr1= GUI Control


|p4= centerX: [[Number]] - Rotation center X in range 0 to 1 (0.5 - control center)
|descr= Sets the rotation of an <tt>ST_PICTURE</tt> control. Rotation will be done within the control boundaries, so if the X and Y are given off center, the picture may get clipped by the control boundaries. Only requires [[ctrlCommit]] when fourth parameter is set to [[false]]. Procedural textures filled controls do not rotate.


|p5= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center)
|s1= control [[ctrlSetAngle]] [angle, centerX, centerY]


| [[Nothing]]
|p1= control: [[Control]] - picture control
 
|s2= control [[ctrlSetAngle]] [angle, centerX, centerY, now] {{Since|arma3|1.78.143717|y}}
 
|p21= control: [[Control]] - picture control


|p22= [angle, centerX, centerY]: [[Array]]
|p2= angle: [[Number]] - Rotation angle (clockwise)


|p23= angle: [[Number]] - Rotation angle (clockwise)
|p3= centerX: [[Number]] - Rotation center X in range 0 to 1. Control center is 0.5


|p24= centerX: [[Number]] - Rotation center X in range 0 to 1 (0.5 - control center)
|p4= centerY: [[Number]] - Rotation center Y in range 0 to 1. Control center is 0.5


|p25= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center)
|p5= now: [[Boolean]] - (Optional, default [[true]]) If [[false]], control will wait for [[ctrlCommit]] input for result to apply


|p26= now: [[Boolean]] - (Optional, default [[true]]) if [[false]], control will wait for [[ctrlCommit]] input for result to apply
|r1= [[Nothing]]
 
|r2= [[Nothing]]


|x1= <code>_control [[ctrlSetAngle]] [25, 0.5, 0.5];</code>
|x1= <code>_control [[ctrlSetAngle]] [25, 0.5, 0.5];</code>
Line 63: Line 52:
|seealso= [[ctrlAngle]]
|seealso= [[ctrlAngle]]
}}
}}
<dl class='command_description'>
<!-- For example:
<dd class='notedate'>Posted on Month Day, Year - Time (UTC)</dd>
<dt class='note'>'''[[User:User Name|User Name]]'''</dt>
<dd class='note'>This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[Magic Variables#this|_this]] == anExample) [[then]] { hint: Leave it here for others to read; };</code></dd>
-->
</dl>
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Revision as of 09:24, 26 April 2021

Hover & click on the images for description

Description

Description:
Sets the rotation of an ST_PICTURE control. Rotation will be done within the control boundaries, so if the X and Y are given off center, the picture may get clipped by the control boundaries. Only requires ctrlCommit when fourth parameter is set to false. Procedural textures filled controls do not rotate.
Groups:
GUI Control

Syntax

Syntax:
control ctrlSetAngle [angle, centerX, centerY]
Parameters:
control: Control - picture control
angle: Number - Rotation angle (clockwise)
centerX: Number - Rotation center X in range 0 to 1. Control center is 0.5
centerY: Number - Rotation center Y in range 0 to 1. Control center is 0.5
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