ctrlSetPosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 75: Line 75:
<dd class="note">
<dd class="note">
If the target ctrl is part of a ctrlGroup, the position needs to be relative to the ctrlGroup position.
If the target ctrl is part of a ctrlGroup, the position needs to be relative to the ctrlGroup position.
</dd>
</dl>
<!-- DISCONTINUE Notes -->
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on July 20, 2017 - 11:56 (UTC)</dd>
<dt class="note">[[User:Yuval|Yuval]]</dt>
<dd class="note">
If the target control is a controls' group, all the child controls of that group will be moved automatically (as their position is relative to the control group rather than the display)
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 12:56, 20 July 2017

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Sets wanted position and size for 2D control animation. Width and height are optional. ctrlCommit is required to complete the operation. For 3D control, param is relative [x,y,z] and no ctrlCommit is required as it cannot be animated.
Groups:
Uncategorised

Syntax 1

Syntax:
controlName ctrlSetPosition [x, y]
Parameters:
controlName: Control - 2D control
[x, y]: Array
Return Value:
Nothing

Syntax 2

Syntax:
controlName ctrlSetPosition [x, y, w, h]
Parameters:
controlName: Control - 2D control
[x, y, w, h]: Array
Return Value:
Nothing

Syntax 3

Syntax:
controlName ctrlSetPosition [x, y, z]
Parameters:
controlName: Control - 3D control
[x, y, z]: Array - y is distance from the screen
Return Value:
Nothing

Examples

Example 1:
Move control: _control2D ctrlSetPosition [0, 0]; _control2D ctrlCommit 0;
Example 2:
Move control and resize:_control2D ctrlSetPosition [0, 0, 1, 1]; _control2D ctrlCommit 0;
Example 3:
_control3D ctrlSetPosition [0.5, 1, 0.5]; //centered and 1m away from screen

Additional Information

See also:
ctrlCommitctrlCreatectrlDeletectrlModelctrlSetModelctrlPositionctrlClassNamedisplayCtrlctrlModelScalectrlSetModelScalectrlModelDirAndUpctrlSetModelDirAndUp

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

Notes

Posted on January 27, 2007 - 19:13
Giova
IMPORTANT You have to use ctrlCommit command to apply this effect(Arma v1.02.5103GER)

Bottom Section

Posted on May 22, 2017 - 23:04 (UTC)
Lucian
If the target ctrl is part of a ctrlGroup, the position needs to be relative to the ctrlGroup position.
Posted on July 20, 2017 - 11:56 (UTC)
Yuval
If the target control is a controls' group, all the child controls of that group will be moved automatically (as their position is relative to the control group rather than the display)