ctrlSetAngle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(description example)
Line 6: Line 6:
|eff=  |= Multiplayer Effects
|eff=  |= Multiplayer Effects
____________________________________________________________________________________________
____________________________________________________________________________________________
| Sets the rotation of a '''3D''' control. |= Description
| Sets the rotation of an <tt>RscPicture</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. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________
| ctrl ctrlSetAngle angle |= Syntax
| control [[ctrlSetAngle]] [angle, centerX, centerY] |= Syntax
|p1= ctrl: [[Control]] |= Parameter 1
|p1= control: [[Control]] |= Parameter 1
|p2= angle: [[Array]] |= Parameter 2
|p2= [angle, centerX, centerY]: [[Array]] |=
|p3= angle: [[Number]] - Rotation angle (clockwise) |= Parameter 3
|p4= centerX: [[Number]] - Rotation center X in range 0 to 1 (0.5 - control center) |= Parameter 4
|p5= centerY: [[Number]] - Rotation center Y in range 0 to 1 (0.5 - control center)|= Parameter 5


| [[Nothing]] |= Return Value
| [[Nothing]] |= Return Value


|x1=<code> _control ctrlSetAngle [25, 0.5, 0.5];</code> |= Example 1
|x1=<code> _control [[ctrlSetAngle]] [25, 0.5, 0.5];</code> |= Example 1
|x2=<code>[[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;
};
};
};</code>|=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 23:57, 29 August 2016

Hover & click on the images for description

Description

Description:
Sets the rotation of an RscPicture 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.
Groups:
Uncategorised

Syntax

Syntax:
control ctrlSetAngle [angle, centerX, centerY]
Parameters:
control: 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

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; }; }; };

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