dxDrawLine | Multi Theft Auto: Wiki Skip to content

dxDrawLine

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function draws a 2D line across the screen - rendered for one frame. This should be used in conjunction with onClientRender in order to display continuously.

Syntax

dxDrawLine ( )

Code Examples

client

This example draws an 'X' across the screen.

local screenWidth, screenHeight = guiGetScreenSize()
local lineColor = tocolor(255, 0, 0)
function drawLinesAcrossScreen()
dxDrawLine(0, 0, screenWidth, screenHeight, lineColor)
dxDrawLine(screenWidth, 0, 0, screenHeight, lineColor)
end
addEventHandler("onClientRender", root, drawLinesAcrossScreen)