dxDrawLine
Client
Draws a 2D line on the screen for one frame.
bool dxDrawLine(float startX, startY, float endX, endY [, color color = tocolor(255, 255, 255), float width = 1, bool postGUI = false])
Parameters
| Name | Type | Description |
|---|---|---|
| startX, startY | float | Start point, in pixels. A vec2 also works. |
| endX, endY | float | End point, in pixels. A vec2 also works. |
| color | color | Colour, a tocolor value.default tocolor(255, 255, 255) |
| width | float | Thickness in pixels.default 1 |
| postGUI | bool | Draw on top of the interface.default false |
Returns
true once the drawing is queued.
Example
local sx, sy = getScreenSize()
addEventHandler("onClientRender", root, function()
dxDrawLine(sx / 2 - 10, sy / 2, sx / 2 + 10, sy / 2, tocolor(255, 255, 255), 2)
dxDrawLine(sx / 2, sy / 2 - 10, sx / 2, sy / 2 + 10, tocolor(255, 255, 255), 2)
end)