HU/dxDrawMaterialLine3D
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.
The 3D line with a large width value effectively becomes a rectangle, so it it possible to construct basic shapes such as boxes with several large width lines and the appropriate values for 'faceToward'.
3D lines are drawn at a particular place in the game processing order, so use onClientPreRender for drawing if you are attaching them to world elements.
Szintaxis
bool dxDrawMaterialLine3D ( float startX, float startY, float startZ, float endX, float endY, float endZ, element material, float width, [ int color = white, [ bool postGUI = false, ] float faceTowardX, float faceTowardY, float faceTowardZ ] )
Kötelező paraméterek
- startX/Y/Z: The start position of the 3D line, representing a coordinate in the GTA world.
- endX/Y/Z: The end position of the 3D line, representing a coordinate in the GTA world.
- 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)
Tetszőleges paraméterek
Megjegyzés: Amikor tetszőleges paramétereket használ, előfordulhat, hogy az összes paramétert meg kell adnia, mielőtt egyet is használna. További információkért látogassa meg a tetszőleges paraméterek oldalt.
- color: An integer of the hex color, produced using tocolor or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).
- postGUI: A bool representing whether the line should be drawn on top of or behind any ingame GUI.
- faceTowardX/Y/Z: The position the front of the line should face towards. If this is not set, the camera position is used, so the front of the line faces toward the camera.
Visszatérési érték
Returns a true if the operation was successful, false otherwise.
Példa
Draws an image in coordiantes -2422.68555, -608.78986, 132.56250
local redcircle = dxCreateTexture("red.png") x,y,z = -2422.68555, -608.78986, 132.56250 size = 1 addEventHandler("onClientRender", root, function() dxDrawMaterialLine3D(x+size, y+size, z-0.95, x-size, y-size, z-0.95, redcircle, size*2,tocolor(255, 255, 255, 255), x, y, z) end)
Requirements
This template will be deleted.
Changelog
Version | Description |
---|
1.5.5-9.11998 | Added postGUI argument |
Lásd még
- HU/dxConvertPixels
- HU/dxCreateFont
- HU/dxCreateRenderTarget
- HU/dxCreateScreenSource
- HU/dxCreateShader
- HU/dxCreateTexture
- HU/dxDrawCircle
- HU/dxDrawImage
- HU/dxDrawImageSection
- HU/dxDrawLine
- HU/dxDrawLine3D
- HU/dxDrawMaterialLine3D
- HU/dxDrawMaterialPrimitive
- HU/dxDrawPrimitive
- HU/dxDrawMaterialSectionLine3D
- HU/dxDrawRectangle
- HU/dxDrawText
- HU/dxGetBlendMode
- HU/dxGetFontHeight
- HU/dxGetMaterialSize
- HU/dxGetPixelColor
- HU/dxGetPixelsSize
- HU/dxGetPixelsFormat
- HU/dxGetStatus
- HU/dxGetTextWidth
- HU/dxGetTexturePixels
- HU/dxSetAspectRatioAdjustmentEnabled
- HU/dxSetBlendMode
- HU/dxSetPixelColor
- HU/dxSetRenderTarget
- HU/dxSetShaderValue
- HU/dxSetShaderTessellation
- HU/dxSetShaderTransform
- HU/dxSetTestMode
- HU/dxSetTextureEdge
- HU/dxSetTexturePixels
- HU/dxUpdateScreenSource