DxDrawRectangle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 6: Line 6:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool dxDrawRectangle ( int startX, startY, float width, float height [, int color] )
bool dxDrawRectangle ( int startX, startY, float width, float height [, int color = white] )
</syntaxhighlight>
</syntaxhighlight>


Line 14: Line 14:
* '''width:''' An float representing the width of the rectangle, drawn in a ''right'' direction from the origin.
* '''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.
* '''height:''' An float representing the height of the rectangle, drawn in a ''downwards'' direction from the origin.
===Optional Arguments===
*'''color:''' the color of the rectangle.


===Returns===
===Returns===

Revision as of 13:49, 5 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 = white] )

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.

Optional Arguments

  • color: the color of the rectangle.

Returns

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

Example

--TODO

See Also