ctrlSetAngle: Difference between revisions
Jump to navigation
Jump to search
m (Boolean reversed in Example 3) |
m (parameter name and description) |
||
Line 17: | Line 17: | ||
| [[Nothing]] |= Return Value | | [[Nothing]] |= Return Value | ||
| s2= control [[ctrlSetAngle]] [angle, centerX, centerY, | | s2= control [[ctrlSetAngle]] [angle, centerX, centerY, now] (''Since Arma 3 v1.78.143717'') |= Syntax | ||
|p21= control: [[Control]] - picture control |= Parameter 1 | |p21= control: [[Control]] - picture control |= Parameter 1 | ||
|p22= [angle, centerX, centerY]: [[Array]] |= | |p22= [angle, centerX, centerY]: [[Array]] |= | ||
Line 23: | Line 23: | ||
|p24= centerX: [[Number]] - Rotation center X in range 0 to 1 (0.5 - control center) |= Parameter 4 | |p24= centerX: [[Number]] - Rotation center X in range 0 to 1 (0.5 - control center) |= Parameter 4 | ||
|p25= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center)|= Parameter 5 | |p25= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center)|= Parameter 5 | ||
|p26= | |p26= now: [[Boolean]] ''(default: [[true]])'' - if [[false]] control will wait for [[ctrlCommit]] input for result to apply |= Parameter 6 | ||
| r2 = [[Nothing]] |= Return Value | | r2 = [[Nothing]] |= Return Value |
Revision as of 21:47, 30 November 2017
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:
- Uncategorised
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] (Since Arma 3 v1.78.143717)
- 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 (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:
- ctrlAnglectrlSetAngle VBS
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