ctrlSetAngle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{uc:{{PAGENAME}}}}" to "")
m (Add since template usage)
Line 8: Line 8:
|gr1= GUI Control |GROUP1=
|gr1= GUI Control |GROUP1=
____________________________________________________________________________________________
____________________________________________________________________________________________
| 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.|DESCRIPTION=
| 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.|DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________
| control [[ctrlSetAngle]] [angle, centerX, centerY] |SYNTAX=
| control [[ctrlSetAngle]] [angle, centerX, centerY] |SYNTAX=
|p1= control: [[Control]] - picture control |PARAMETER1=
|p1= control: [[Control]] - picture control |PARAMETER1=
|p2=  [angle, centerX, centerY]: [[Array]] |Parameter2=
|p2=  [angle, centerX, centerY]: [[Array]] |Parameter2=


|p3= angle: [[Number]] - Rotation angle (clockwise) |PARAMETER3=
|p3= angle: [[Number]] - Rotation angle (clockwise) |PARAMETER3=
|p4= centerX: [[Number]] - Rotation center X in range 0 to 1 (0.5 - control center) |PARAMETER4=
|p4= centerX: [[Number]] - Rotation center X in range 0 to 1 (0.5 - control center) |PARAMETER4=
|p5= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center)|PARAMETER5=
|p5= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center)|PARAMETER5=


| [[Nothing]] |RETURNVALUE=
| [[Nothing]] |RETURNVALUE=
____________________________________________________________________________________________


| s2= control [[ctrlSetAngle]] [angle, centerX, centerY, now] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (''Since Arma 3 v1.78.143717'') |SYNTAX2=
|s2= control [[ctrlSetAngle]] [angle, centerX, centerY, now] {{since|arma3|1.78.143717|y}} |SYNTAX2=


|p21= control: [[Control]] - picture control |PARAMETER21=
|p21= control: [[Control]] - picture control |PARAMETER21=
|p22= [angle, centerX, centerY]: [[Array]] |PARAMETER22=
 
|p22= [angle, centerX, centerY]: [[Array]] |PARAMETER22=
 
|p23= angle: [[Number]] - Rotation angle (clockwise) |PARAMETER23=
|p23= angle: [[Number]] - Rotation angle (clockwise) |PARAMETER23=


Line 30: Line 38:
|p25= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center)|PARAMETER25=
|p25= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center)|PARAMETER25=


|p26= now: [[Boolean]] ''(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]] |RETURNVALUE2=
|r2= [[Nothing]] |RETURNVALUE2=


|x1=<code> _control [[ctrlSetAngle]] [25, 0.5, 0.5];</code> |EXAMPLE1=
|x1= <code>_control [[ctrlSetAngle]] [25, 0.5, 0.5];</code> |EXAMPLE1=
 
|x2=<code>[[with]] [[uiNamespace]] [[do]]
|x2=<code>[[with]] [[uiNamespace]] [[do]]
{
{
Line 51: Line 60:
};
};
};
};
};</code>|Example2=
};</code>|EXAMPLE2=
|x3=<code>_control [[ctrlSetAngle]] [25, 0.5, 0.5, [[false]]];
 
_control [[ctrlCommit]] 1; // Rotation applies smoothly for 1 second.
|x3= <code>_control [[ctrlSetAngle]] [25, 0.5, 0.5, [[false]]];
</code> |EXAMPLE3=
_control [[ctrlCommit]] 1; {{cc|Rotation applies smoothly for 1 second.}}</code> |EXAMPLE3=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 23:45, 23 December 2020

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. 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

Bottom Section