dxDrawMaterialSectionLine3D | Multi Theft Auto: Wiki Skip to content

dxDrawMaterialSectionLine3D

Client-side
Server-side
Shared

Manual Review Required

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


This function draws a textured 3D line between two points in the 3D world - rendered for one frame. This should be used in conjunction with onClientPreRender in order to display continuously.

Syntax

bool dxDrawMaterialSectionLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ, float u, float v, float usize, float vsize, element material, float width, float faceTowardY, float faceTowardZ, [ bool flipUV = false, int color = white, [ bool stage = "postfx", ] float faceTowardX ] )
Required Arguments
  • startX: MISSING_PARAM_DESC
  • startY: MISSING_PARAM_DESC
  • startZ: MISSING_PARAM_DESC
  • endX: MISSING_PARAM_DESC
  • endY: MISSING_PARAM_DESC
  • endZ: MISSING_PARAM_DESC
  • u: the absolute X coordinate of the top left corner of the section
  • v: the absolute Y coordinate of the top left corner of the section
  • usize: the absolute width of the section
  • vsize: the absolute height of the section
  • material: A material to draw the line with.
  • width: The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)
  • faceTowardY: MISSING_PARAM_DESC
  • faceTowardZ: MISSING_PARAM_DESC
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • flipUV (default: false): MISSING_PARAM_DESC
  • color (default: white): MISSING_PARAM_DESC
  • bool stage (default: "postfx", ] float faceTowardX): MISSING_PARAM_DESC

Returns

  • bool: value

Returns a true if the operation was successful, false otherwise.

Code Examples

shared

This example draws corona like effects near the player

coronaTexture = dxCreateTexture("corona.png")
red = tocolor(255,0,0)
green = tocolor(0,255,0)
blue = tocolor(0,0,255)
addEventHandler("onClientPreRender",root,
function()
local x,y,z = getElementPosition(localPlayer)
dxSetBlendMode("add") -- Add blend mode looks best for corona effects
drawCorona( x+2, y+2, z+1, 1, red )
drawCorona( x+1, y+3, z+2, 1, green )
drawCorona( x-1, y+2, z+3, 1, blue )
dxSetBlendMode("blend") -- Restore default
end
)
-- Draw the corona texture
function drawCorona( x, y, z, size, color )
dxDrawMaterialSectionLine3D ( x, y, z+size,
x, y, z-size,
0,0,1,1, coronaTexture, size, color)
end