ctrlMapWorldToScreen: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(error in syntax)
m (Text replacement - ">Posted on June ([0-9]{2})[ a-zA-Z]*, ([0-9]{4})" to ">Posted on $2-06-$1")
 
(51 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1
|version1= 1.05


|1.05|= Game version
|game2= arma2
____________________________________________________________________________________________
|version2= 1.00


| Transfers a map control world position to screen coordinates. |= Description
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| control '''ctrlMapWorldToScreen''' position |= Syntax
|game4= tkoh
|version4= 1.00


|p1= control: [[Control]] |= Parameter 1
|game5= arma3
|p2= position: [[Position]] |= Parameter 2
|version5= 0.50


| [[Array]] ([[Position2D]] Format) |= Return value
|gr1= GUI Control - Map
____________________________________________________________________________________________
 
|x1= <code>_screenCoord = _control [[ctrlMapWorldToScreen]] _worldCoord;</code> |= Example 1
|x2= <code>_screenCoord = _control [[ctrlMapWorldToScreen]] [[position]] [[player]];</code> |= Example 2


____________________________________________________________________________________________
|descr= Converts world coordinates into map screen coordinates. This command is identical to [[posWorldToScreen]].


| [[ctrlMapScreenToWorld]] |= See also
|s1= control [[ctrlMapWorldToScreen]] position


|p1= control : [[Control]] - map control
|p2= position : [[Array]] - world position in format [[Position#Introduction|Position2D]] or [[Position#Introduction|Position3D]]
|r1= [[Array]] - screen coordinates in format [x, y]
|x1= <sqf>_screenCoord = _control ctrlMapWorldToScreen _worldCoord;</sqf>
|x2= <sqf>_screenCoord = _control ctrlMapWorldToScreen position player;</sqf>
|seealso= [[ctrlMapScreenToWorld]] [[posWorldToScreen]]
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">


<!-- Note Section BEGIN -->
<dt><dt>
 
<dd class="notedate">Posted on 2010-06-16</dd>
<dd class="notedate">Posted on June 16, 2010
<dt class="note">[[User:kju|kju]]</dt>
<dt class="note">'''[[User:kju|kju]]'''<dd class="note">''Notes:''
<dd class="note">
It 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>
In other words you can make the actual world position (of an object for example), relative to your active map display.
In other words you can make the actual world position (of an object for example), relative to your active map display.


<!-- Note Section END -->
</dl>
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_GUI_Control|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 00:08, 14 May 2023

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 - 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:
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.