ctrlMapWorldToScreen: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Take[ _]On[ _]Helicopters(\|.*)?\]\]" to "{{GameCategory|tkoh|Scripting Commands}}") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Command|Comments= | {{Command|Comments= | ||
| arma1 |Game name= | | arma1 |Game name= | ||
Line 7: | Line 6: | ||
|gr1= GUI Control - Map |GROUP1= | |gr1= GUI Control - Map |GROUP1= | ||
| Converts world coordinates into map screen coordinates. This command is identical to [[posWorldToScreen]]. |DESCRIPTION= | | Converts world coordinates into map screen coordinates. This command is identical to [[posWorldToScreen]]. |DESCRIPTION= | ||
| control [[ctrlMapWorldToScreen]] position |SYNTAX= | | control [[ctrlMapWorldToScreen]] position |SYNTAX= | ||
Line 19: | Line 16: | ||
| [[Array]] - screen coordinates in format [x, y] |RETURNVALUE= | | [[Array]] - screen coordinates in format [x, y] |RETURNVALUE= | ||
|x1= <code>_screenCoord = _control [[ctrlMapWorldToScreen]] _worldCoord;</code> |EXAMPLE1= | |x1= <code>_screenCoord = _control [[ctrlMapWorldToScreen]] _worldCoord;</code> |EXAMPLE1= | ||
|x2= <code>_screenCoord = _control [[ctrlMapWorldToScreen]] [[position]] [[player]];</code> |EXAMPLE2= | |x2= <code>_screenCoord = _control [[ctrlMapWorldToScreen]] [[position]] [[player]];</code> |EXAMPLE2= | ||
| [[ctrlMapScreenToWorld]], [[posWorldToScreen]] |SEEALSO= | | [[ctrlMapScreenToWorld]], [[posWorldToScreen]] |SEEALSO= |
Revision as of 00:44, 17 January 2021
Description
- Description:
- Converts world coordinates into map screen coordinates. This command is identical to posWorldToScreen.
- Groups:
- GUI Control - Map
Syntax
- Syntax:
- control ctrlMapWorldToScreen position
- Parameters:
- control : Control - map control
- position : Array - world position in format Position2D or Position3D
- Return Value:
- Array - screen coordinates in format [x, y]
Examples
- Example 1:
_screenCoord = _control ctrlMapWorldToScreen _worldCoord;
- Example 2:
_screenCoord = _control ctrlMapWorldToScreen position player;
Additional Information
- See also:
- ctrlMapScreenToWorldposWorldToScreen
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
- Posted on June 16, 2010
- kju
-
This command returns a 2D array with the position on the active map display. Say the return [0.5.0.5] would mean that your input 3d world position, like [500,1000], is currently at the center of the active map display.
In other words you can make the actual world position (of an object for example), relative to your active map display.