DxDrawLine3D: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 17: | Line 17: | ||
==Example== | ==Example== | ||
This is a small example of creating 3D Line / "Rope" between vehicle and player. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | testVehicle = createVehicle ( 411, 0, 0, 5 ) -- Create our test vehicle. | ||
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. | |||
addEventHandler("onClientRender",getRootElement(), createLine) -- onClientRender keeps the 3D Line visible. | |||
end | |||
addCommandHandler("test", createLine) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Drawing_functions}} | {{Drawing_functions}} |
Revision as of 20:57, 29 February 2008
for reference until documented: dxDrawLine3D ( x1, y1, z1, x2, y2, z2, tocolor ( r, g, b, a ), width )
Syntax
Required Arguments
Returns
Example
This is a small example of creating 3D Line / "Rope" between vehicle and player.
testVehicle = createVehicle ( 411, 0, 0, 5 ) -- Create our test vehicle. 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. addEventHandler("onClientRender",getRootElement(), createLine) -- onClientRender keeps the 3D Line visible. end addCommandHandler("test", createLine)
See Also
- dxConvertPixels
- dxCreateFont
- dxCreateRenderTarget
- dxCreateScreenSource
- dxCreateShader
- dxCreateTexture
- dxDrawCircle
- dxDrawImage
- dxDrawImageSection
- dxDrawLine
- dxDrawLine3D
- dxDrawMaterialLine3D
- dxDrawMaterialPrimitive
- dxDrawMaterialPrimitive3D
- dxDrawMaterialSectionLine3D
- dxDrawPrimitive
- dxDrawPrimitive3D
- dxDrawRectangle
- dxDrawText
- dxDrawWiredSphere
- dxGetBlendMode
- dxGetFontHeight
- dxGetMaterialSize
- dxGetPixelColor
- dxGetPixelsSize
- dxGetPixelsFormat
- dxGetStatus
- dxGetTextSize
- dxGetTextWidth
- dxGetTexturePixels
- dxIsAspectRatioAdjustmentEnabled
- dxSetAspectRatioAdjustmentEnabled
- dxSetBlendMode
- dxSetPixelColor
- dxSetRenderTarget
- dxSetShaderValue
- dxSetShaderTessellation
- dxSetShaderTransform
- dxSetTestMode
- dxSetTextureEdge
- dxSetTexturePixels
- dxUpdateScreenSource