HU/dxDrawMaterialLine3D: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function hu}}
{{Client function hu}}
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.
Ez a function 3D-s vonalat rajzol a 3D-s világ két pontja között - egy képkocka erejéig van kirajzolva. Ezt az [[onClientRender]] segítségével együtt kell használni annak érdekében, hogy folyamatosan jelenjen meg.


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'.
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|game processing order]], so use [[onClientPreRender]] for drawing if you are attaching them to world elements.
A 3D-s vonalak egy adott helyen vannak rajzolva a [[Game_Processing_Order|játékfeldolgozási sorrendben]], ezért használja az [[onClientPreRender]] a rajzoláshoz, ha a world elemhez akarja csatolni őket.


==Szintaxis==
==Szintaxis==
Line 14: Line 14:


===Kötelező paraméterek===  
===Kötelező paraméterek===  
* '''startX/Y/Z:''' The start position of the 3D line, representing a coordinate in the GTA world.
* '''startX/Y/Z:''' A 3D-s vonal kezdetének pozíciója, amely egy koordinátát képvisel a GTA világában.
* '''endX/Y/Z:''' The end position of the 3D line, representing a coordinate in the GTA world.
* '''endX/Y/Z:''' A 3D-s vonal végének pozíciója, amely egy koordinátát képvisel a GTA világában.
* '''material:''' A [[material]] to draw the line with.
* '''material:''' Az [[material|anyag]], amivel a vonalat rajzolja.
* '''width:''' The width/thickness of the line in GTA world units. (This is 1/75th of the width used in dxDrawLine3D)
* '''width:''' A vonal szélessége/vastagsága a GTA világban. (Ez a dxDrawLine3D-ben használt szélesség 1/75-öd része)


==Tetszőleges paraméterek==
==Tetszőleges paraméterek==
Line 23: Line 23:
* '''color:''' A hexadecimális szín, melyet a [[tocolor]]-al vagy az 0xAARRGGBB fügvénnyel tudunk megadni (AA = átlászóság, RR = piros, GG = zöld, BB = kék).
* '''color:''' A hexadecimális szín, melyet a [[tocolor]]-al vagy az 0xAARRGGBB fügvénnyel tudunk megadni (AA = átlászóság, RR = piros, GG = zöld, BB = kék).
{{New items|3.0156|1.5.5|
{{New items|3.0156|1.5.5|
* '''postGUI''': Egy igaz/hamis érték, mely azt képviseli, hogy a vonal bármelyik ingame GUI mögött, vagy fölött legyen-e.
* '''postGUI''': Egy igaz/hamis érték mutatja, hogy a vonal bármelyik ingame GUI mögött, vagy fölött legyen-e.
|11998}}
|11998}}
* '''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.
* '''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.
Line 31: Line 31:


==Példa==  
==Példa==  
Jajzol [[:File:DxDrawMaterialLine3D-example.png|egy képet]] ezekben a kordinátákban: -2422.68555, -608.78986, 132.56250
Rajzol [[:File:DxDrawMaterialLine3D-example.png|egy képet]] a megadott kordinátákban -2422.68555, -608.78986, 132.56250
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local redcircle = dxCreateTexture("red.png")
local redcircle = dxCreateTexture("red.png")

Latest revision as of 13:21, 13 May 2019

Ez a function 3D-s vonalat rajzol a 3D-s világ két pontja között - egy képkocka erejéig van kirajzolva. Ezt az onClientRender segítségével együtt kell használni annak érdekében, hogy folyamatosan jelenjen meg.

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'.

A 3D-s vonalak egy adott helyen vannak rajzolva a játékfeldolgozási sorrendben, ezért használja az onClientPreRender a rajzoláshoz, ha a world elemhez akarja csatolni őket.

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: A 3D-s vonal kezdetének pozíciója, amely egy koordinátát képvisel a GTA világában.
  • endX/Y/Z: A 3D-s vonal végének pozíciója, amely egy koordinátát képvisel a GTA világában.
  • material: Az anyag, amivel a vonalat rajzolja.
  • width: A vonal szélessége/vastagsága a GTA világban. (Ez a dxDrawLine3D-ben használt szélesség 1/75-öd része)

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: A hexadecimális szín, melyet a tocolor-al vagy az 0xAARRGGBB fügvénnyel tudunk megadni (AA = átlászóság, RR = piros, GG = zöld, BB = kék).
  • postGUI: Egy igaz/hamis érték mutatja, hogy a vonal bármelyik ingame GUI mögött, vagy fölött legyen-e.
  • 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

Visszatérési értéke true, ha a művelet sikeres, egyébként false.

Példa

Rajzol egy képet a megadott kordinátákban -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

Minimum server version n/a
Minimum client version 1.3.0-9.03931

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.3.0-9.03931" />

Changelog

Version Description
1.5.5-9.11998 Added postGUI argument

Lásd még

Fordította