worldToScreen: Difference between revisions
m (Added version to alt syntax) |
(updated format for parsing) |
||
| Line 23: | Line 23: | ||
|s1= [[worldToScreen]] position | |s1= [[worldToScreen]] position | ||
|p1= position: [[ | |p1= position: [[Position#Position2D|Position2D]], [[Position#PositionAGL|PositionAGL]] | ||
|r1= [[Array]] - screen position in [[SafeZone] | |r1= [[Array]] with [x, y] - screen position in [[SafeZone]]. Returns an empty array {{hl|[]}} if not on-screen. | ||
* x: [[Number]] | |||
* y: [[Number]] | |||
|s2= camera [[worldToScreen]] position | |s2= camera [[worldToScreen]] position | ||
| Line 32: | Line 34: | ||
|p21= camera: [[Object]] - camera object | |p21= camera: [[Object]] - camera object | ||
|p22= position: [[ | |p22= position: [[Position#Position2D|Position2D]], [[Position#PositionAGL|PositionAGL]] | ||
|r2= [[Array]] - screen position in [[SafeZone]] | |r2= [[Array]] with [x, y] - screen position in [[SafeZone]]. Returns an empty array {{hl|[]}} if not on-screen. | ||
* x: [[Number]] | |||
* y: [[Number]] | |||
|x1= <sqf>_screenPos = worldToScreen ASLToAGL getPosASL soldier1;</sqf> | |x1= <sqf>_screenPos = worldToScreen ASLToAGL getPosASL soldier1;</sqf> | ||
Latest revision as of 20:00, 5 January 2026
Description
- 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.
- Groups:
- Positions
Syntax
- Syntax:
- worldToScreen position
- Parameters:
- position: Position2D, PositionAGL
- Return Value:
- Array with [x, y] - screen position in SafeZone. Returns an empty array [] if not on-screen.
Alternative Syntax
- Syntax:
- camera worldToScreen position
- Parameters:
- camera: Object - camera object
- position: Position2D, PositionAGL
- Return Value:
- Array with [x, y] - screen position in SafeZone. Returns an empty array [] if not on-screen.
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- screenToWorld SafeZone
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note