ctrlMapSetPosition: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (Created page with "{{RV|type=command |game1= arma 3 |version1= 2.06 |gr1= GUI Control - Map |branch= dev |descr= Sets position and size of the given map control and recalculates control cen...") |
Killzone Kid (talk | contribs) No edit summary |
||
Line 10: | Line 10: | ||
|descr= Sets position and size of the given map control and recalculates control center. The effect is immediate and no [[ctrlCommit]] is necessary, unlike with [[ctrlSetPosition]] command. | |descr= Sets position and size of the given map control and recalculates control center. The effect is immediate and no [[ctrlCommit]] is necessary, unlike with [[ctrlSetPosition]] command. | ||
{{Feature|Informative|The Map control is different from other controls and normally doesn't behave well inside Controls Groups. When this command is used on the Map control inside a Controls Group, The `x` and `y` will be treated as relative position to the top left of Controls Group. Use this command to set position before you | {{Feature|Informative|The Map control is different from other controls and normally doesn't behave well inside Controls Groups. When this command is used on the Map control inside a Controls Group, The `x` and `y` will be treated as relative position to the top left of Controls Group. Use this command to set position before you use [[ctrlMapAnimAdd]]. Use this command to update Map control after its position or size had been changed or the Map control was created dynamically (Example 2). If you move Controls Group, use this command to refresh Map control (Example 3). }} | ||
|s1= map [[ctrlMapSetPosition]] [x, y, w, h] | |s1= map [[ctrlMapSetPosition]] [x, y, w, h] |
Revision as of 10:33, 24 May 2021
Description
- Description:
- Sets position and size of the given map control and recalculates control center. The effect is immediate and no ctrlCommit is necessary, unlike with ctrlSetPosition command.
- Groups:
- GUI Control - Map
Syntax
- Syntax:
- map ctrlMapSetPosition [x, y, w, h]
- Parameters:
- map: - Control - map control
- [x, y, w, h] - Array
- x (Optional): - Number - left top x of map control
- y (Optional): - Number - left top y of map control
- w (Optional): - Number - width of map control
- h (Optional): - Number - height of map control
- Return Value:
- Nothing
Examples
- Example 1:
_map ctrlMapSetPosition [0,0,1,1];
- Example 2:
_map ctrlSetPosition [0.5, 0.5, 0.5, 0.5]; _map ctrlCommit 0; _map ctrlMapSetPosition []; // sync
- Example 3:
with localNamespace do { private _display = findDisplay 46 createDisplay "RscDisplayEmpty"; private _ctrlGroup = _display ctrlCreate ["RscControlsGroup", -1]; private _ctrlText = _display ctrlCreate ["RscText", -1, _ctrlGroup]; _ctrltext ctrlSetPosition [0, 0, 1, 1]; _ctrlText ctrlSetBackgroundColor [1, 0, 0, 0.5]; _ctrlText ctrlCommit 0; private _ctrlMap = _display ctrlCreate ["RscMapControl", -1, _ctrlGroup]; _ctrlMap ctrlMapSetPosition [0, 0, 0.5, 0.5]; // effect is immediate _ctrlMap ctrlMapAnimAdd [0, ctrlMapScale _ctrlMap, player]; ctrlMapAnimCommit _ctrlMap; _ctrlGroup ctrlSetPosition [safeZoneX, safeZoneY, 1, 1]; _ctrlGroup ctrlCommit 0.3; // non instant transition _ctrlMap ctrlMapSetPosition []; // instant sync to new _ctrlGroup position };
Additional Information
- See also:
- ctrlSetPositionctrlMapAnimAddctrlCreate
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