ctrlMapWorldToScreen: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *(arg|eff|mp|serverExec|gr[0-9]) *= *(.*) * *\|([^=]{12})" to "|$1=$2 |descr=$3")
mNo edit summary
 
(13 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma1
|game1= arma1
|1.05
|version1= 1.05


|game2= arma2
|game2= arma2
Line 20: Line 20:
|descr= Converts world coordinates into map screen coordinates. This command is identical to [[posWorldToScreen]].
|descr= Converts world coordinates into map screen coordinates. This command is identical to [[posWorldToScreen]].


|s1= control [[ctrlMapWorldToScreen]] position
|s1= control [[ctrlMapWorldToScreen]] position


|p1= control : [[Control]] - map control
|p1= control : [[Control]] - map control


|p2= position : [[Array]] - world position in format [[Position2D]] or [[Position3D]]
|p2= position : [[Array]] format [[Position#Introduction|Position2D]] or [[Position#Introduction|Position3D]] - world position


|r1=[[Array]] - screen coordinates in format [x, y]
|r1= [[Array]] - screen coordinates in format [x, y]


|x1= <code>_screenCoord = _control [[ctrlMapWorldToScreen]] _worldCoord;</code>
|x1= <sqf>_screenCoord = _control ctrlMapWorldToScreen _worldCoord;</sqf>


|x2= <code>_screenCoord = _control [[ctrlMapWorldToScreen]] [[position]] [[player]];</code>
|x2= <sqf>_screenCoord = _control ctrlMapWorldToScreen position player;</sqf>


|seealso= [[ctrlMapScreenToWorld]], [[posWorldToScreen]]
|seealso= [[ctrlMapScreenToWorld]] [[posWorldToScreen]]
}}
}}


Line 38: Line 38:


<dt><dt>
<dt><dt>
<dd class="notedate">Posted on June 16, 2010</dd>
<dd class="notedate">Posted on 2010-06-16</dd>
<dt class="note">[[User:kju|kju]]</dt>
<dt class="note">[[User:.kju|.kju]]</dt>
<dd class="note">
<dd class="note">
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.<br>
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.<br>
Line 45: Line 45:


</dl>
</dl>
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}

Latest revision as of 10:21, 16 June 2024

Hover & click on the images for description

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 format Position2D or Position3D - world position
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:
ctrlMapScreenToWorld posWorldToScreen

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
Posted on 2010-06-16
.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.