DxDrawLine3D
From Multi Theft Auto: Wiki
This function draws a 3D line between two points in the 3D world - rendered for one frame. This should be used in conjunction with onClientRender in order to display continuously.
Syntax
Required Arguments
- startX: The start X position of the 3D line, representing a coordinate in the GTA world.
- startY: The start Y position of the 3D line, representing a coordinate in the GTA world.
- startZ: The start Z position of the 3D line, representing a coordinate in the GTA world.
- endX: The end X position of the 3D line, representing a coordinate in the GTA world.
- endY: The end Y position of the 3D line, representing a coordinate in the GTA world.
- endZ: The end Z position of the 3D line, representing a coordinate in the GTA world.
- color: An integer of the hex color, produced using tocolor or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).
Optional Arguments
NOTE: When using optional arguments, you must supply all arguments before the one you wish to use. For more information on optional arguments, see Optional Arguments.
- width: The width/thickness of the line
- postGUI: A bool representing whether the line should be drawn on top of or behind any ingame GUI (rendered by CEGUI).
Returns
Returns a true if the operation was successful, false otherwise.
Example
Click to collapse [-]
ClientThis is a small example of creating 3D Line / "Rope" between vehicle and player.
function makeLineAppear() testVehicle = createVehicle ( 411, 0, 0, 5 ) -- Create our test vehicle. addEventHandler("onClientRender", getRootElement(), createLine) -- onClientRender keeps the 3D Line visible. end function createLine ( ) x1, y1, z1 = getElementPosition ( testVehicle ) -- Get test vehicles position. x2, y2, z2 = getElementPosition ( getLocalPlayer ()) -- Get local players position. dxDrawLine3D ( x1, y1, z1, x2, y2, z2, tocolor ( 0, 255, 0, 230 ), 2) -- Create 3D Line between test vehicle and local player. end addCommandHandler("test", makeLineAppear)
See Also
- dxDrawImage
- dxDrawImageSection
- dxDrawLine
- dxDrawLine3D
- dxDrawRectangle
- dxDrawText
- dxGetFontHeight
- dxGetTextWidth
- dxCreateFont
- dxCreateTexture
- dxCreateShader
- dxCreateRenderTarget
- dxCreateScreenSource
- dxGetMaterialSize
- dxSetShaderValue
- dxSetShaderTessellation
- dxSetShaderTransform
- dxSetRenderTarget
- dxUpdateScreenSource
- dxGetStatus
- dxSetTestMode
- dxGetTexturePixels
- dxSetTexturePixels
- dxGetPixelsSize
- dxGetPixelsFormat
- dxConvertPixels
- dxGetPixelColor
- dxSetPixelColor
FROM VERSION 1.3.1 ONWARDS