{"name":"posScreenToWorld","title":"posScreenToWorld","type":"command","url":"https://community.bistudio.com/wiki/posScreenToWorld","revid":379457,"updated":"2026-10-31T00:09:04Z","groups":["Positions"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","description":"Converts map screen coordinates into world coordinates. Unlike ctrlMapScreenToWorld, this command returns world position is format [x, y, 0], otherwise it is identical to it.","syntaxes":[{"syntax":"map posScreenToWorld [x, y]","params":[{"name":"map","type":"Control","description":"map control","type_expr":"Control"},{"name":"x","type":"Number","description":"screen X","type_expr":"Number"},{"name":"y","type":"Number","description":"screen Y","type_expr":"Number"}],"returns":{"type":"Position3D","type_expr":"Position3D","description":"world position in format [x,y,0]"},"form":"binary","left":{"text":"map"},"right":{"text":"[x, y]"}}],"examples":[{"code":["_worldCoord = _control posScreenToWorld _ScreenCoord;"]},{"code":["_worldCoord = _control posScreenToWorld [_x, _y];"]},{"code":["_worldCoord = _control posScreenToWorld [0.5, 0.5];"]}],"see_also":["posWorldToScreen","ctrlMapScreenToWorld","ctrlMapWorldToScreen"],"notes":[{"user":"LowFly","date":"2007-04-07T10:03:00Z","text":"*Notes:*\n\nYou can get the screen coordinates by the UI Event Handlers onMouseButtonDown, onMouseButtonUp, onMouseButtonClick, onMouseButtonDblClick.\n\nThe return Array is in 2D, you can use it with all set-position commands.\n\n```sqf\n_x = returnArray select 0;\n_y = returnArray select 1;\n```"}]}