DxRectangle

From Multi Theft Auto: Wiki
Revision as of 17:27, 5 January 2023 by OfficialMr3b (talk | contribs) (Created page with "__NOTOC__ {{Client function}} This function draws a dxRectangle but it will make it relative. ==Syntax== <syntaxhighlight lang="lua"> bool dxRectangle ( float startX, float startY, float width, float height [, int color = white, bool postGUI = false, bool subPixelPositioning = false ] ) </syntaxhighlight> ===Required Arguments=== * '''startX:''' An float representing the '''absolute''' origin X position of the rectangle, represented by pixels on the screen. * '''sta...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function draws a dxRectangle but it will make it relative.

Syntax

bool dxRectangle ( float startX, float startY, float width, float height [, int color = white, bool postGUI = false, bool subPixelPositioning = false ] )

Required Arguments

  • startX: An float representing the absolute origin X position of the rectangle, represented by pixels on the screen.
  • startY: An float 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 hex color of the rectangle, produced using tocolor or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).
  • postGUI: A bool representing whether the line should be drawn on top of or behind any ingame GUI.
ADDED/UPDATED IN VERSION 1.4.0 r6931:
  • subPixelPositioning: A bool representing whether the rectangle can be positioned sub-pixel-ly.

Returns

Returns true if the operation was successful, false otherwise.

Example

Click to collapse [-]
Client
loadstring(exports.fixing:import())()

function drawStuff()
	dxRectangle(630, 446, 106, 26, tocolor(51, 51, 51, 255), false)
end
addEventHandler("onClientRender", root, drawStuff) r.

See Also