ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. dxDrawGradientRectangle

Function

dxDrawGradientRectangle

ClientDrawing (dx)Trilogy Hub only

Draws a rectangle with a vertical blend from the top colour to the bottom one.

Syntax

bool dxDrawGradientRectangle(float x, float y, float width, float height [, int colorTop = tocolor(255, 255, 255), int colorBottom = tocolor(255, 255, 255), bool postGUI = false])

Arguments

xfloat
Left edge.
yfloat
Top edge.
widthfloat
Width.
heightfloat
Height.
colorTopint, optional = tocolor(255, 255, 255)
Top colour.
colorBottomint, optional = tocolor(255, 255, 255)
Bottom colour.
postGUIbool, optional = false
Above GUI.

Returns

true if drawn.

Example

local sw, sh = guiGetScreenSize()
addEventHandler("onClientRender", root, function()
    dxDrawGradientRectangle(0, sh - 120, sw, 120, tocolor(0, 0, 0, 0), tocolor(0, 0, 0, 200))
end)

See also