worldToScreen: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "PositionAGL" to "PositionAGL") |
(updated format for parsing) |
||
| (13 intermediate revisions by 3 users not shown) | |||
| Line 23: | Line 23: | ||
|s1= [[worldToScreen]] position | |s1= [[worldToScreen]] position | ||
|p1= position: [[ | |p1= position: [[Position#Position2D|Position2D]], [[Position#PositionAGL|PositionAGL]] | ||
|r1= [[Array]] - | |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 | ||
|s2since= arma3 2.18 | |||
| | |p21= camera: [[Object]] - camera object | ||
|seealso= [[screenToWorld]] | |p22= position: [[Position#Position2D|Position2D]], [[Position#PositionAGL|PositionAGL]] | ||
|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> | |||
|x2= <sqf>_screenPos = worldToScreen (player modelToWorld [0,10,0]);</sqf> | |||
|seealso= [[screenToWorld]] [[SafeZone]] | |||
}} | }} | ||
Latest revision as of 19: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