ctrlSetAngle: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>([^<]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^<]*) *<\/code>" to "<code>$1$2$3</code>") |
Lou Montana (talk | contribs) m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>") |
||
Line 27: | Line 27: | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= < | |x1= <sqf>_control ctrlSetAngle [25, 0.5, 0.5];</sqf> | ||
|x2= < | |x2= <sqf>with uiNamespace do | ||
{ | { | ||
ctrl = findDisplay 46 ctrlCreate ["RscPictureKeepAspect", -1]; | ctrl = findDisplay 46 ctrlCreate ["RscPictureKeepAspect", -1]; | ||
Line 45: | Line 45: | ||
}; | }; | ||
}; | }; | ||
};</ | };</sqf> | ||
|x3= < | |x3= <sqf>_control ctrlSetAngle [25, 0.5, 0.5, false]; | ||
_control ctrlCommit 1; // Rotation applies smoothly for 1 second.</ | _control ctrlCommit 1; // Rotation applies smoothly for 1 second.</sqf> | ||
|seealso= [[ctrlAngle]] | |seealso= [[ctrlAngle]] | ||
}} | }} |
Revision as of 11:22, 13 May 2022
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, now]
- 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
- 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 or on the Forums.
Only post proven facts here! Add Note