DxDrawLine: 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__  
__NOTOC__  
{{Client function}}  
{{Client function}}  
This function draws a 2D line across the screen - rendered for '''one''' frame.  This should be used in conjunction with [[onClientRender]] in order to display continuously.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
 
bool dxDrawLine ( int startX, int startY, int endX, int endY, int color, [float width=1,bool postGUI=false] )
</syntaxhighlight>
</syntaxhighlight>


===Required Arguments===  
===Required Arguments===  
 
* '''startX:''' An integer representing the '''absolute''' start X position of the line, represented by pixels on the screen.
* '''startY:''' An integer representing the '''absolute''' start Y position of the line, represented by pixels on the screen.
* '''startX:''' An integer representing the '''absolute''' end X position of the line, represented by pixels on the screen.
* '''startY:''' An integer representing the '''absolute''' end Y position of the line, represented by pixels on the screen.
* '''color:''' An integer of the hex color, produced using [[tocolor]].
* '''width:''' The width/thickness of the line
* '''postGUI:''' A bool representing whether the line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).


===Returns===
===Returns===
 
Returns a true if the operation was successful, false otherwise.


==Example==  
==Example==  
Line 20: Line 27:
==See Also==
==See Also==
{{Drawing_functions}}
{{Drawing_functions}}
[[Category:Needs_Example]]

Revision as of 18:57, 2 March 2008

This function draws a 2D line across the screen - rendered for one frame. This should be used in conjunction with onClientRender in order to display continuously.

Syntax

bool dxDrawLine ( int startX, int startY, int endX, int endY, int color, [float width=1,bool postGUI=false] )

Required Arguments

  • startX: An integer representing the absolute start X position of the line, represented by pixels on the screen.
  • startY: An integer representing the absolute start Y position of the line, represented by pixels on the screen.
  • startX: An integer representing the absolute end X position of the line, represented by pixels on the screen.
  • startY: An integer representing the absolute end Y position of the line, represented by pixels on the screen.
  • color: An integer of the hex color, produced using tocolor.
  • width: The width/thickness of the line
  • postGUI: A bool representing whether the line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).

Returns

Returns a true if the operation was successful, false otherwise.

Example

--TODO

See Also