M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
startX, startYfloatStart point, in pixels. A vec2 also works.
endX, endYfloatEnd point, in pixels. A vec2 also works.
colorcolorColour, a tocolor value.default tocolor(255, 255, 255)
widthfloatThickness in pixels.default 1
postGUIboolDraw 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)

See also