Difference between revisions of "ctrlMapSetPosition"
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \| *(game[0-9]|version[0-9]|gr[0-9]|serverExec|mp|pr|descr|s[0-9]|p[0-9]{1,3}|r[0-9]|x1?[0-9]|seealso) *= +" to " |$1= ") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 5: | Line 5: | ||
|gr1= GUI Control - Map | |gr1= GUI Control - Map | ||
− | |||
− | |||
|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. | ||
Line 13: | Line 11: | ||
|s1= map [[ctrlMapSetPosition]] [x, y, w, h] | |s1= map [[ctrlMapSetPosition]] [x, y, w, h] | ||
− | |p1= map: | + | |p1= map: [[Control]] - [[CT_MAP|Map control]] |
− | |p2 | + | |
− | + | |p2= x: [[Number]] - (Optional) Left top x of map control | |
− | | | + | |
− | | | + | |p3= y: [[Number]] - (Optional) Left top y of map control |
− | | | + | |
+ | |p4= w: [[Number]] - (Optional) Width of map control | ||
+ | |||
+ | |p5= h: [[Number]] - (Optional) Height of map control | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
− | |x1= < | + | |x1= <sqf>_map ctrlMapSetPosition [0,0,1,1];</sqf> |
− | |x2= < | + | |x2= <sqf> |
− | _map | + | _map ctrlSetPosition [0.5, 0.5, 0.5, 0.5]; |
− | _map | + | _map ctrlCommit 0; |
+ | _map ctrlMapSetPosition []; // sync | ||
+ | </sqf> | ||
− | |x3= < | + | |x3= <sqf> |
+ | with localNamespace do | ||
{ | { | ||
− | + | private _display = findDisplay 46 createDisplay "RscDisplayEmpty"; | |
− | + | private _ctrlGroup = _display ctrlCreate ["RscControlsGroup", -1]; | |
− | + | private _ctrlText = _display ctrlCreate ["RscText", -1, _ctrlGroup]; | |
− | _ctrltext | + | _ctrltext ctrlSetPosition [0, 0, 1, 1]; |
− | _ctrlText | + | _ctrlText ctrlSetBackgroundColor [1, 0, 0, 0.5]; |
− | _ctrlText | + | _ctrlText ctrlCommit 0; |
− | + | private _ctrlMap = _display ctrlCreate ["RscMapControl", -1, _ctrlGroup]; | |
− | _ctrlMap | + | _ctrlMap ctrlMapSetPosition [0, 0, 0.5, 0.5]; // effect is immediate |
− | _ctrlMap | + | _ctrlMap ctrlMapAnimAdd [0, ctrlMapScale _ctrlMap, player]; |
− | + | ctrlMapAnimCommit _ctrlMap; | |
− | _ctrlGroup | + | _ctrlGroup ctrlSetPosition [safeZoneX, safeZoneY, 1, 1]; |
− | _ctrlGroup | + | _ctrlGroup ctrlCommit 0.3; // non instant transition |
− | _ctrlMap | + | _ctrlMap ctrlMapSetPosition []; // instant sync to new _ctrlGroup position |
− | };</ | + | }; |
+ | </sqf> | ||
− | |seealso= [[ctrlSetPosition]] | + | |seealso= [[ctrlMapPosition]] [[ctrlSetPosition]] [[ctrlMapAnimAdd]] [[ctrlCreate]] |
}} | }} |
Latest revision as of 17:44, 5 May 2022
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: Number - (Optional) Left top x of map control
- y: Number - (Optional) Left top y of map control
- w: Number - (Optional) Width of map control
- h: Number - (Optional) Height of map control
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
- 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
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