ctrlSetAngle: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
|arma3 | |arma3 | ||
|1.62 | |1.62 | ||
|arg | |arg= | ||
|eff | |eff= | ||
|gr1= GUI Control | |gr1= GUI Control | ||
| 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. | | 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. | ||
| control [[ctrlSetAngle]] [angle, centerX, centerY] | | control [[ctrlSetAngle]] [angle, centerX, centerY] | ||
|p1= control: [[Control]] - picture control | |p1= control: [[Control]] - picture control | ||
|p2= [angle, centerX, centerY]: [[Array]] | |p2= [angle, centerX, centerY]: [[Array]] | ||
|p3= angle: [[Number]] - Rotation angle (clockwise) | |p3= angle: [[Number]] - Rotation angle (clockwise) | ||
|p4= centerX: [[Number]] - Rotation center X in range 0 to 1 (0.5 - control center) | |p4= centerX: [[Number]] - Rotation center X in range 0 to 1 (0.5 - control center) | ||
|p5= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center) | |p5= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center) | ||
| [[Nothing]] | | [[Nothing]] | ||
|s2= control [[ctrlSetAngle]] [angle, centerX, centerY, now] {{Since|arma3|1.78.143717|y}} | |s2= control [[ctrlSetAngle]] [angle, centerX, centerY, now] {{Since|arma3|1.78.143717|y}} | ||
|p21= control: [[Control]] - picture control |PARAMETER21= | |p21= control: [[Control]] - picture control |PARAMETER21= | ||
Line 36: | Line 36: | ||
|p26= now: [[Boolean]] - (Optional, default [[true]]) if [[false]], control will wait for [[ctrlCommit]] input for result to apply |PARAMETER26= | |p26= now: [[Boolean]] - (Optional, default [[true]]) if [[false]], control will wait for [[ctrlCommit]] input for result to apply |PARAMETER26= | ||
|r2= [[Nothing]] | |r2= [[Nothing]] | ||
|x1= <code>_control [[ctrlSetAngle]] [25, 0.5, 0.5];</code> | |x1= <code>_control [[ctrlSetAngle]] [25, 0.5, 0.5];</code> | ||
|x2=<code>[[with]] [[uiNamespace]] [[do]] | |x2=<code>[[with]] [[uiNamespace]] [[do]] | ||
Line 56: | Line 56: | ||
}; | }; | ||
}; | }; | ||
};</code> | };</code> | ||
|x3= <code>_control [[ctrlSetAngle]] [25, 0.5, 0.5, [[false]]]; | |x3= <code>_control [[ctrlSetAngle]] [25, 0.5, 0.5, [[false]]]; | ||
_control [[ctrlCommit]] 1; {{cc|Rotation applies smoothly for 1 second.}}</code> | _control [[ctrlCommit]] 1; {{cc|Rotation applies smoothly for 1 second.}}</code> | ||
| [[ctrlAngle]] | | [[ctrlAngle]] | ||
}} | }} | ||
Revision as of 01:27, 18 January 2021
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. Doesn't require ctrlCommit. Procedural textures filled controls do not rotate.
- Groups:
- GUI Control
Syntax
- Syntax:
- control ctrlSetAngle [angle, centerX, centerY]
- 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:
- Nothing
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