Graphics::drawBox: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(yay)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
x,y,z = start pos<br>x2,y2,z2 = end pos<br><br>Draw's a 3D Box between the two x,y,z coords.<br>--------------<br>Keep in mind that the edges of the box do only align to the worlds base-vectors. Therefore something like rotation cannot be applied. That means this function is pretty much useless, unless you want a static unicolor box somewhere.<br>I recommend using a predefined function to call this.<br>[VB.NET]<br>Public Sub DrawBox(a As Vector3, b As Vector3, col As Color)<br>    [Function].Call(Hash.DRAW_BOX,a.X, a.Y, a.Z,b.X, b.Y, b.Z,col.R, col.G, col.B, col.A)<br>End Sub<br><br>[C#]<br>public void DrawBox(Vector3 a, Vector3 b, Color col)<br>{<br>    Function.Call(Hash.DRAW_BOX,a.X, a.Y, a.Z,b.X, b.Y, b.Z,col.R, col.G, col.B, col.A);<br>}==Syntax==<syntaxhighlight lang="javascript">graphics.drawBox(x1, y1, z1, x2, y2, z2, r, g, b, alpha);</syntaxhighlight>=== 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==<syntaxhighlight lang="javascript">todo</syntaxhighlight>==See also=={{Graphics_function_c}}[[Category:Clientside API]][[Category:TODO: Example]]
x,y,z = start pos<br>x2,y2,z2 = end pos<br><br>Draw's a 3D Box between the two x,y,z coords.<br>--------------<br>Keep in mind that the edges of the box do only align to the worlds base-vectors. Therefore something like rotation cannot be applied. That means this function is pretty much useless, unless you want a static unicolor box somewhere.<br>I recommend using a predefined function to call this.<br>[VB.NET]<br>Public Sub DrawBox(a As Vector3, b As Vector3, col As Color)<br>    [Function].Call(Hash.DRAW_BOX,a.X, a.Y, a.Z,b.X, b.Y, b.Z,col.R, col.G, col.B, col.A)<br>End Sub<br><br>[C#]<br>public void DrawBox(Vector3 a, Vector3 b, Color col)<br>{<br>    Function.Call(Hash.DRAW_BOX,a.X, a.Y, a.Z,b.X, b.Y, b.Z,col.R, col.G, col.B, col.A);<br>}
==Syntax==
<syntaxhighlight lang="javascript">mp.game.graphics.drawBox(x1, y1, z1, x2, y2, z2, r, g, b, alpha);</syntaxhighlight>
=== 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==
<syntaxhighlight lang="javascript">
// todo
</syntaxhighlight>
==See also==
{{Graphics_s_function_c}}
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 21:27, 6 May 2017

x,y,z = start pos
x2,y2,z2 = end pos

Draw's a 3D Box between the two x,y,z coords.
--------------
Keep in mind that the edges of the box do only align to the worlds base-vectors. Therefore something like rotation cannot be applied. That means this function is pretty much useless, unless you want a static unicolor box somewhere.
I recommend using a predefined function to call this.
[VB.NET]
Public Sub DrawBox(a As Vector3, b As Vector3, col As Color)
[Function].Call(Hash.DRAW_BOX,a.X, a.Y, a.Z,b.X, b.Y, b.Z,col.R, col.G, col.B, col.A)
End Sub

[C#]
public void DrawBox(Vector3 a, Vector3 b, Color col)
{
Function.Call(Hash.DRAW_BOX,a.X, a.Y, a.Z,b.X, b.Y, b.Z,col.R, col.G, col.B, col.A);
}

Syntax

mp.game.graphics.drawBox(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