Jump to content

API Mouse.GetPosition2D: Difference between revisions

From Flowcode Help
JonnyW (talk | contribs)
XML import of API documentation
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{| class="mtx-class-macrotable wikitable"
 
|-
<sidebar>API Contents</sidebar>
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
Gets the X/Y position of the mouse in screen coords
| width="90%" class="mtx-class-macrohead" | '''GetPosition2D'''
 
|-
<div style="width:25%; float:right" class="toc">
| colspan="2" | Gets the X/Y position of the mouse in screen coords&nbsp;
====Class hierarchy====
|-
[[API Mouse|Mouse]]
|-
:[[API Mouse|GetPosition2D]]
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
</div>
| width="90%" | X
__TOC__
|-
 
| colspan="2" | Pixel screen coordinate from the left of the panel area&nbsp;
==Parameters==
|-
[[Variable Types|LONG]] ''X''
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
:Pixel screen coordinate from the left of the panel area
| width="90%" | Y
:''This parameter is returned back to the caller''
|-
 
| colspan="2" | Pixel screen coordinate from the top of the panel area&nbsp;
[[Variable Types|LONG]] ''Y''
|-
:Pixel screen coordinate from the top of the panel area
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - NONE
:''This parameter is returned back to the caller''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
==Return value==
[[Variable Types|HANDLE]]
 
Returns the X/Y position of the mouse in screen coords




Line 38: Line 33:
* Declare a variable 'result' of type HANDLE
* Declare a variable 'result' of type HANDLE
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Mouse.GetPosition2D(return_x, return_y)</pre>
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Mouse.GetPosition2D(return_x, return_y)</pre>
''<span style="color:red;">No additional examples</span>''

Latest revision as of 14:11, 13 July 2026

GetPosition2D
Gets the X/Y position of the mouse in screen coords 
- LONG X
Pixel screen coordinate from the left of the panel area 
- LONG Y
Pixel screen coordinate from the top of the panel area 
- NONE Return


Detailed description

This gets the X/Y position in screen units relative to the top left corner of the panel the mouse is over. If the mouse is not over a panel the last known position is used.


Note that the coordinates returned from this call are not 3D coordinates.


Examples

Calling in a calculation

  • Declare a variable 'result' of type HANDLE
  • Add to a calculation icon:
    result = ::Mouse.GetPosition2D(return_x, return_y)