GetScreenFromWorldPosition: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
{{Client function}}
This function gets the screen position of a point in the world. This is useful for attaching 2D gui elements to parts of the world (e.g. players) or detecting if a point is on the screen (though it does not check if it is actually visible, you should use [[processLineOfSight]] for that).
This function gets the screen position of a point in the world. This is useful for attaching 2D gui elements to parts of the world (e.g. players) or detecting if a point is on the screen (though it does not check if it is actually visible, you should use [[processLineOfSight]] for that).


Line 5: Line 7:
float float getScreenFromWorldPosition ( float x, float y, float z )
float float getScreenFromWorldPosition ( float x, float y, float z )
</syntaxhighlight>
</syntaxhighlight>
{{Client function}}
 
===Required Arguments===
*'''x:''' A float value indicating the x position in the world.
*'''y:''' A float value indicating the y position in the world.
*'''z:''' A float value indicating the z position in the world.
 
===Returns===
Returns two ''x'', ''y'' [[float]]s indicating the screen position if successful, ''false'' otherwise.
 
==See Also==
{{Client_world_functions}}

Revision as of 05:41, 24 April 2009

This function gets the screen position of a point in the world. This is useful for attaching 2D gui elements to parts of the world (e.g. players) or detecting if a point is on the screen (though it does not check if it is actually visible, you should use processLineOfSight for that).

Syntax

float float getScreenFromWorldPosition ( float x, float y, float z )

Required Arguments

  • x: A float value indicating the x position in the world.
  • y: A float value indicating the y position in the world.
  • z: A float value indicating the z position in the world.

Returns

Returns two x, y floats indicating the screen position if successful, false otherwise.

See Also