Created
July 27, 2017 17:08
-
-
Save commy2/639ecd74e7fba364207f7e44edfbd94e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My_Draw_PFH = objNull; | |
addMissionEventHandler ["MapSingleClick", { | |
if (isNull My_Draw_PFH) then { | |
params ["", "_pos"]; | |
My_Draw_PFH = [ | |
{ | |
private _pos1 = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld getMousePosition; | |
private _sizeX = abs ((_pos0 select 0) - (_pos1 select 0)); | |
private _sizeY = abs ((_pos0 select 1) - (_pos1 select 1)); | |
_marker setMarkerPosLocal (_pos0 vectorAdd [_sizeX / 2, _sizeY / 2, 0]); | |
_marker setMarkerSizeLocal [_sizeX, _sizeY]; | |
}, 0, _pos, { | |
_pos0 = _this getVariable "params"; | |
_marker = createMarkerLocal ["My_Temp", _pos0]; | |
_marker setMarkerShapeLocal "RECTANGLE"; | |
_marker setMarkerColorLocal "ColorBlack"; | |
}, { | |
deleteMarker _marker; | |
}, nil, { | |
!visibleMap | |
}, ["_marker", "_pos0"] | |
] call CBA_fnc_createPerFrameHandlerObject; | |
} else { | |
My_Draw_PFH call CBA_fnc_deletePerFrameHandlerObject; | |
}; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment