OnClientCursorMove: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Incomplete Event]]
[[Category:Incomplete Event]]
 
{{Client event}}
__NOTOC__  
__NOTOC__  
This event is called by the root element whenever the cursor is moved over the screen, by the player. It returns information about the world coordinates as well as the screen coordinates of where the player moved the cursor.
This event is called by the root element whenever the cursor is moved over the screen, by the player. It returns information about the world coordinates as well as the screen coordinates of where the player moved the cursor.
Line 6: Line 6:
The difference between this event and [[onClientMouseMove]], is that the latter is actually called by GUI elements. This is to prevent double calling of onClientCursorMove, as onClientCursorMove is always called.
The difference between this event and [[onClientMouseMove]], is that the latter is actually called by GUI elements. This is to prevent double calling of onClientCursorMove, as onClientCursorMove is always called.


==Syntax==  
==Parameters==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
void onClientCursorMove ( float cursorX, float cursorY, int absoluteX, int absoluteY, float worldX, float worldY, float worldZ )
float cursorX, float cursorY, int absoluteX, int absoluteY, float worldX, float worldY, float worldZ
</syntaxhighlight>  
</syntaxhighlight>
*'''cursorX:''' the relative X coordinate of the mouse cursor. 0 = left side of the screen, 1 = right side.
*'''cursorY:''' the relative Y coordinate of the mouse cursor. 0 = top of the screen, 1 = bottom.
*'''absoluteX:''' the X coordinate of the mouse cursor, in pixels, measured from the left side of the screen.
*'''absoluteY:''' the Y coordinate of the mouse cursor, in pixels, measured from the top of the screen.
*'''worldX, worldY, worldZ:''' the 3D in-game world coordinates that the cursor is pointing at.
 
==Source==
The source of this event is the root element.
 
==Example==


==Example==
This example does...
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
 
blabhalbalhb --abababa
--This line does this...
mooo
</syntaxhighlight>
</syntaxhighlight>

Revision as of 17:19, 30 December 2007

This event is called by the root element whenever the cursor is moved over the screen, by the player. It returns information about the world coordinates as well as the screen coordinates of where the player moved the cursor.

The difference between this event and onClientMouseMove, is that the latter is actually called by GUI elements. This is to prevent double calling of onClientCursorMove, as onClientCursorMove is always called.

Parameters

float cursorX, float cursorY, int absoluteX, int absoluteY, float worldX, float worldY, float worldZ
  • cursorX: the relative X coordinate of the mouse cursor. 0 = left side of the screen, 1 = right side.
  • cursorY: the relative Y coordinate of the mouse cursor. 0 = top of the screen, 1 = bottom.
  • absoluteX: the X coordinate of the mouse cursor, in pixels, measured from the left side of the screen.
  • absoluteY: the Y coordinate of the mouse cursor, in pixels, measured from the top of the screen.
  • worldX, worldY, worldZ: the 3D in-game world coordinates that the cursor is pointing at.

Source

The source of this event is the root element.

Example