When using it on a map control which was created with ctrlCreate and its position and size does not cover the whole screen, the position set in ctrlMapAnimAdd has an offset.
Description
Description
Details
Details
- Severity
- Major
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 10 x64
- Category
- Scripting
Steps To Reproduce
- Create a mission in the editor
- Place a player and press preview
- Execute the following code from the debug console
[] spawn { disableSerialization; private _display = (call BIS_fnc_displayMission) createDisplay "DisplaySimulated"; private _ctrlMap = _display ctrlCreate ["RscMapControl", -1]; _ctrlMap ctrlSetPosition [0, 0, 1, 1]; _ctrlMap ctrlCommit 0; for "_i" from 0 to 8 do { private _rndPos = [] call BIS_fnc_randomPos; private _marker = createMarker ["testMarker_" + str _i, _rndPos]; // Not visible yet. _marker setMarkerType "hd_dot"; // Visible. _ctrlMap ctrlMapAnimAdd [0.8, ctrlMapScale _ctrlMap, _rndPos]; ctrlMapAnimCommit _ctrlMap; waitUntil {ctrlMapAnimDone _ctrlMap}; systemChat "Next animation in 3 seconds!"; sleep 1; if (_i == 4) then { systemChat "Now with a map control which covers the whole screen!"; systemChat "See how map is now properly centered on the markers!"; _ctrlMap ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH]; _ctrlMap ctrlCommit 1; waitUntil {ctrlCommitted _ctrlMap}; }; }; ctrlDelete _ctrlMap; };
First four markers show how the command is bugged. After that, the map gets resized and the positions are displayed correctly.
Related Objects
Related Objects
Event Timeline
Comment Actions
Works nicely. Tested with
[] spawn { disableSerialization; private _display = (call BIS_fnc_displayMission) createDisplay "DisplaySimulated"; private _ctrlMap = _display ctrlCreate ["RscMapControl", -1]; _ctrlMap ctrlMapSetPosition [0, 0, 1, 1]; allMapMarkers apply {deleteMarker _x}; for "_i" from 0 to 8 do { private _rndPos = [] call BIS_fnc_randomPos; private _marker = createMarker ["testMarker_" + str _i, _rndPos]; // Not visible yet. _marker setMarkerType "hd_dot"; // Visible. _ctrlMap ctrlMapAnimAdd [0.8, ctrlMapScale _ctrlMap, _rndPos]; ctrlMapAnimCommit _ctrlMap; waitUntil {ctrlMapAnimDone _ctrlMap}; systemChat "Next animation in 3 seconds!"; sleep 1; if (_i == 4) then { systemChat "Now with a map control which covers the whole screen!"; systemChat "See how map is now properly centered on the markers!"; _ctrlMap ctrlMapSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH]; waitUntil {ctrlCommitted _ctrlMap}; }; }; ctrlDelete _ctrlMap; };