Graphics::drawLine: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(yay)
Line 1: Line 1:
Draws a depth-tested line from one point to another.<br>----------------<br>x1, y1, z1 : Coordinates for the first point<br>x2, y2, z2 : Coordinates for the second point<br>r, g, b, alpha : Color with RGBA-Values<br>I recommend using a predefined function to call this.<br>[VB.NET]<br>Public Sub DrawLine(from As Vector3, [to] As Vector3, col As Color)<br>    [Function].Call(Hash.DRAW_LINE, from.X, from.Y, from.Z, [to].X, [to].Y, [to].Z, col.R, col.G, col.B, col.A)<br>End Sub<br><br>[C#]<br>public void DrawLine(Vector3 from, Vector3 to, Color col)<br>{<br>    Function.Call(Hash.DRAW_LINE, from.X, from.Y, from.Z, to.X, to.Y, to.Z, col.R, col.G, col.B, col.A);<br>}
Draws a depth-tested line from one point to another.<br>----------------<br>x1, y1, z1 : Coordinates for the first point<br>x2, y2, z2 : Coordinates for the second point<br>r, g, b, alpha : Color with RGBA-Values<br>I recommend using a predefined function to call this.<br>[VB.NET]<br>Public Sub DrawLine(from As Vector3, [to] As Vector3, col As Color)<br>    [Function].Call(Hash.DRAW_LINE, from.X, from.Y, from.Z, [to].X, [to].Y, [to].Z, col.R, col.G, col.B, col.A)<br>End Sub<br><br>[C#]<br>public void DrawLine(Vector3 from, Vector3 to, Color col)<br>{<br>    Function.Call(Hash.DRAW_LINE, from.X, from.Y, from.Z, to.X, to.Y, to.Z, col.R, col.G, col.B, col.A);<br>}
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">graphics.drawLine(x1, y1, z1, x2, y2, z2, r, g, b, alpha);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.graphics.drawLine(x1, y1, z1, x2, y2, z2, r, g, b, alpha);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''x1:''' float
*'''x1:''' float
Line 17: Line 17:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
// todo
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Graphics_function_c}}
{{Graphics_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Revision as of 21:13, 6 May 2017

Draws a depth-tested line from one point to another.
----------------
x1, y1, z1 : Coordinates for the first point
x2, y2, z2 : Coordinates for the second point
r, g, b, alpha : Color with RGBA-Values
I recommend using a predefined function to call this.
[VB.NET]
Public Sub DrawLine(from As Vector3, [to] As Vector3, col As Color)
[Function].Call(Hash.DRAW_LINE, from.X, from.Y, from.Z, [to].X, [to].Y, [to].Z, col.R, col.G, col.B, col.A)
End Sub

[C#]
public void DrawLine(Vector3 from, Vector3 to, Color col)
{
Function.Call(Hash.DRAW_LINE, from.X, from.Y, from.Z, to.X, to.Y, to.Z, col.R, col.G, col.B, col.A);
}

Syntax

mp.game.graphics.drawLine(x1, y1, z1, x2, y2, z2, r, g, b, alpha);

Required Arguments

  • x1: float
  • y1: float
  • z1: float
  • x2: float
  • y2: float
  • z2: float
  • r: int
  • g: int
  • b: int
  • alpha: int

Return value

  • Undefined

Example

// todo

See also