DxDrawRectangle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ {{Client function}} ==Syntax== <syntaxhighlight lang="lua"> </syntaxhighlight> ===Required Arguments=== ===Returns=== ==Example== <syntaxhighlight lang="lua"> --TODO </syntaxhighlight> ==See Also== {{Drawing_functions}})
 
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}  
{{Client function}}  
This function draws a 2D rectangle 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 dxDrawRectangle ( int startX, startY, float width, float height [, int color] )
</syntaxhighlight>
</syntaxhighlight>


===Required Arguments===  
===Required Arguments===  
 
* '''startX:''' An integer representing the '''absolute''' origin X position of the rectangle, represented by pixels on the screen.
* '''startY:''' An integer representing the '''absolute''' origin Y position of the rectangle, represented by pixels on the screen.
* '''width:''' An float representing the width of the rectangle, drawn in a ''right'' direction from the origin.
* '''height:''' An float representing the height of the rectangle, drawn in a ''downwards'' direction from the origin.


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


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

Revision as of 19:04, 2 March 2008

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


Syntax

bool dxDrawRectangle ( int startX, startY, float width, float height [, int color] )

Required Arguments

  • startX: An integer representing the absolute origin X position of the rectangle, represented by pixels on the screen.
  • startY: An integer representing the absolute origin Y position of the rectangle, represented by pixels on the screen.
  • width: An float representing the width of the rectangle, drawn in a right direction from the origin.
  • height: An float representing the height of the rectangle, drawn in a downwards direction from the origin.

Returns

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

Example

--TODO

See Also