ctrlSetAngle: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *R([a-z ])" to "$1 - r$2") |
BrettMayson (talk | contribs) mNo edit summary |
||
| (One intermediate revision by one other user not shown) | |||
| Line 10: | Line 10: | ||
|gr1= GUI Control | |gr1= GUI Control | ||
|descr= Sets the rotation of a control set as {{hl|ST_PICTURE}}. 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. Supported control types: | |descr= Sets the rotation of a control set as {{hl|ST_PICTURE}}. 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. Supported control types: | |||
* [[CT_STATIC]] | * [[CT_STATIC]] | ||
* [[CT_ACTIVETEXT]] | * {{GVI|arma3|2.10|size= 0.75}} [[CT_ACTIVETEXT]] | ||
{{Feature|important|Images that touch borders may "bleed" during rotation transformation, to avoid this, make sure the image has 1px transparent padding}} | {{Feature|important|Images that touch borders may "bleed" during rotation transformation, to avoid this, make sure the image has a 1px transparent padding.}} | ||
|s1= control [[ctrlSetAngle]] [angle, centerX, centerY, now] | |s1= control [[ctrlSetAngle]] [angle, centerX, centerY, now] | ||
| Line 22: | Line 23: | ||
|p2= angle: [[Number]] - rotation angle (clockwise) | |p2= angle: [[Number]] - rotation angle (clockwise) | ||
|p3= centerX: [[Number]] - rotation center X | |p3= centerX: [[Number]] in range 0..1 - rotation center X. Control center is 0.5 | ||
|p4= centerY: [[Number]] - rotation center Y | |p4= centerY: [[Number]] in range 0..1 - rotation center Y. Control center is 0.5 | ||
|p5= now: [[Boolean]] - (Optional, default [[true]]) if [[false]], control will wait for [[ctrlCommit]] input for result to apply | |p5= now: [[Boolean]] - (Optional, default [[true]]) if [[false]], control will wait for [[ctrlCommit]] input for result to apply | ||
| Line 33: | Line 34: | ||
|x1= <sqf>_control ctrlSetAngle [25, 0.5, 0.5];</sqf> | |x1= <sqf>_control ctrlSetAngle [25, 0.5, 0.5];</sqf> | ||
|x2= <sqf>with uiNamespace do | |x2= <sqf> | ||
with uiNamespace do | |||
{ | { | ||
ctrl = findDisplay 46 ctrlCreate ["RscPictureKeepAspect", -1]; | ctrl = findDisplay 46 ctrlCreate ["RscPictureKeepAspect", -1]; | ||
| Line 44: | Line 46: | ||
with uiNamespace do | with uiNamespace do | ||
{ | { | ||
if (angle > 359) then {angle = 0}; | if (angle > 359) then { angle = 0 }; | ||
ctrl ctrlSetAngle [angle, 0.5, 0.5]; | ctrl ctrlSetAngle [angle, 0.5, 0.5]; | ||
angle = angle + 1; | angle = angle + 1; | ||
}; | }; | ||
}; | }; | ||
};</sqf> | }; | ||
</sqf> | |||
|x3= <sqf>_control ctrlSetAngle [25, 0.5, 0.5, false]; | |x3= <sqf> | ||
_control ctrlCommit 1; // Rotation applies smoothly for 1 second.</sqf> | _control ctrlSetAngle [25, 0.5, 0.5, false]; | ||
_control ctrlCommit 1; // Rotation applies smoothly for 1 second. | |||
</sqf> | |||
|seealso= [[ctrlAngle]] | |seealso= [[ctrlAngle]] | ||
}} | }} | ||
Latest revision as of 06:57, 1 January 2026
Description
- Description:
- Sets the rotation of a control set as ST_PICTURE. 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. Supported control types:
- Groups:
- GUI Control
Syntax
- Syntax:
- control ctrlSetAngle [angle, centerX, centerY, now]
- Parameters:
- control: Control - picture control
- angle: Number - rotation angle (clockwise)
- centerX: Number in range 0..1 - rotation center X. Control center is 0.5
- centerY: Number in range 0..1 - rotation center Y. Control center is 0.5
- since
1.78 - 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.
Only post proven facts here! Add Note