{"name":"worldToScreen","title":"worldToScreen","type":"command","url":"https://community.bistudio.com/wiki/worldToScreen","revid":377903,"updated":"2026-01-05T18:00:13Z","groups":["Positions"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Converts position in world space into screen (UI) space. If a specified position is not within the current screen view, an empty array is returned.\n\n> [!NOTE]\n> SafeZones should be considered:\n>\n> - the result can be out of the [0,0]..[1,1] range\n> - the result can be a filled array even if the position is not displayed on screen if it would appear on a triplescreen setup","syntaxes":[{"syntax":"worldToScreen position","params":[{"name":"position","type":"Position2D, PositionAGL","type_expr":"Position2D | PositionAGL"}],"returns":{"type":"Array","type_expr":"Array","description":"with [x, y] - screen position in SafeZone. Returns an empty array `[]` if not on-screen.\n- x: Number - y: Number","text":"Array with [x, y] - screen position in SafeZone. Returns an empty array `[]` if not on-screen.\n\n- x: Number\n- y: Number"},"form":"unary","right":{"text":"position"}},{"syntax":"camera worldToScreen position","since":"arma3 2.18","params":[{"name":"camera","type":"Object","description":"camera object","type_expr":"Object"},{"name":"position","type":"Position2D, PositionAGL","type_expr":"Position2D | PositionAGL"}],"returns":{"type":"Array","type_expr":"Array","description":"with [x, y] - screen position in SafeZone. Returns an empty array `[]` if not on-screen.\n- x: Number - y: Number","text":"Array with [x, y] - screen position in SafeZone. Returns an empty array `[]` if not on-screen.\n\n- x: Number\n- y: Number"},"form":"binary","left":{"text":"camera"},"right":{"text":"position"}}],"examples":[{"code":["_screenPos = worldToScreen ASLToAGL getPosASL soldier1;"]},{"code":["_screenPos = worldToScreen (player modelToWorld [0,10,0]);"]}],"see_also":["screenToWorld","SafeZone"]}