DxRectangle: Difference between revisions
Jump to navigation
Jump to search
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...") |
OfficialMr3b (talk | contribs) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 17: | Line 17: | ||
*'''color:''' the hex color of the rectangle, produced using [[tocolor]] or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue). | *'''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. | * '''postGUI:''' A bool representing whether the line should be drawn on top of or behind any ingame GUI. | ||
*'''subPixelPositioning:''' A bool representing whether the rectangle can be positioned sub-pixel-ly. | *'''subPixelPositioning:''' A bool representing whether the rectangle can be positioned sub-pixel-ly. | ||
===Returns=== | ===Returns=== | ||
Returns true if the operation was successful, false otherwise. | Returns true if the operation was successful, false otherwise. | ||
==Resource== | |||
[https://wiki.multitheftauto.com/wiki/Resource:RDX RDX] | |||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
loadstring(exports. | loadstring(exports.rdx:import())() | ||
function drawStuff() | function drawStuff() | ||
dxRectangle(630, 446, 106, 26, tocolor(51, 51, 51, 255), false) | dxRectangle(630, 446, 106, 26, tocolor(51, 51, 51, 255), false) | ||
end | end | ||
addEventHandler("onClientRender", root, drawStuff) | addEventHandler("onClientRender", root, drawStuff) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Latest revision as of 17:32, 5 January 2023
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.
- subPixelPositioning: A bool representing whether the rectangle can be positioned sub-pixel-ly.
Returns
Returns true if the operation was successful, false otherwise.
Resource
Example
Click to collapse [-]
Clientloadstring(exports.rdx:import())() function drawStuff() dxRectangle(630, 446, 106, 26, tocolor(51, 51, 51, 255), false) end addEventHandler("onClientRender", root, drawStuff)
See Also
- dxConvertPixels
- dxCreateFont
- dxCreateRenderTarget
- dxCreateScreenSource
- dxCreateShader
- dxCreateTexture
- dxDrawCircle
- dxDrawImage
- dxDrawImageSection
- dxDrawLine
- dxDrawLine3D
- dxDrawMaterialLine3D
- dxDrawMaterialPrimitive
- dxDrawMaterialPrimitive3D
- dxDrawMaterialSectionLine3D
- dxDrawPrimitive
- dxDrawPrimitive3D
- dxDrawRectangle
- dxDrawText
- dxDrawWiredSphere
- dxGetBlendMode
- dxGetFontHeight
- dxGetMaterialSize
- dxGetPixelColor
- dxGetPixelsSize
- dxGetPixelsFormat
- dxGetStatus
- dxGetTextSize
- dxGetTextWidth
- dxGetTexturePixels
- dxIsAspectRatioAdjustmentEnabled
- dxSetAspectRatioAdjustmentEnabled
- dxSetBlendMode
- dxSetPixelColor
- dxSetRenderTarget
- dxSetShaderValue
- dxSetShaderTessellation
- dxSetShaderTransform
- dxSetTestMode
- dxSetTextureEdge
- dxSetTexturePixels
- dxUpdateScreenSource