Graphics::drawMarker: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(yay)
Line 1: Line 1:
enum MarkerTypes<br>{<br> MarkerTypeUpsideDownCone = 0,<br> MarkerTypeVerticalCylinder = 1,<br> MarkerTypeThickChevronUp = 2,<br> MarkerTypeThinChevronUp = 3,<br> MarkerTypeCheckeredFlagRect = 4,<br> MarkerTypeCheckeredFlagCircle = 5,<br> MarkerTypeVerticleCircle = 6,<br> MarkerTypePlaneModel = 7,<br> MarkerTypeLostMCDark = 8,<br> MarkerTypeLostMCLight = 9,<br> MarkerTypeNumber0 = 10,<br> MarkerTypeNumber1 = 11,<br> MarkerTypeNumber2 = 12,<br> MarkerTypeNumber3 = 13,<br> MarkerTypeNumber4 = 14,<br> MarkerTypeNumber5 = 15,<br> MarkerTypeNumber6 = 16,<br> MarkerTypeNumber7 = 17,<br> MarkerTypeNumber8 = 18,<br> MarkerTypeNumber9 = 19,<br> MarkerTypeChevronUpx1 = 20,<br> MarkerTypeChevronUpx2 = 21,<br> MarkerTypeChevronUpx3 = 22,<br> MarkerTypeHorizontalCircleFat = 23,<br> MarkerTypeReplayIcon = 24,<br> MarkerTypeHorizontalCircleSkinny = 25,<br> MarkerTypeHorizontalCircleSkinny_Arrow = 26,<br> MarkerTypeHorizontalSplitArrowCircle = 27,<br> MarkerTypeDebugSphere = 28,<br> MarkerTypeDallorSign = 29,<br> MarkerTypeHorizontalBars = 30,<br> MarkerTypeWolfHead = 31<br>};<br><br>dirX/Y/Z represent a heading on each axis in which the marker should face, alternatively you can rotate each axis independently with rotX/Y/Z (and set dirX/Y/Z all to 0).<br><br>faceCamera - Rotates only the y-axis (the heading) towards the camera<br><br>p19 - no effect, default value in script is 2<br><br>rotate - Rotates only on the y-axis (the heading)<br><br>textureDict - Name of texture dictionary to load texture from (e.g. 'GolfPutting')<br><br>textureName - Name of texture inside dictionary to load (e.g. 'PuttingMarker')<br><br>drawOnEnts - Draws the marker onto any entities that intersect it<br><br>basically what he said, except textureDict and textureName are totally not char*, or if so, then they are always set to 0/NULL/nullptr in every script I checked, eg:<br><br>bj.c: graphics::draw_marker(6, vParam0, 0f, 0f, 1f, 0f, 0f, 0f, 4f, 4f, 4f, 240, 200, 80, iVar1, 0, 0, 2, 0, 0, 0, false);<br><br>his is what I used to draw an amber downward pointing chevron 'V', has to be redrawn every frame.  The 180 is for 180 degrees rotation around the Y axis, the 50 is alpha, assuming max is 100, but it will accept 255.<br><br>GRAPHICS::DRAW_MARKER(2, v.x, v.y, v.z + 2, 0, 0, 0, 0, 180, 0, 2, 2, 2, 255, 128, 0, 50, 0, 1, 1, 0, 0, 0, 0);<br><br>
enum MarkerTypes<br>{<br> MarkerTypeUpsideDownCone = 0,<br> MarkerTypeVerticalCylinder = 1,<br> MarkerTypeThickChevronUp = 2,<br> MarkerTypeThinChevronUp = 3,<br> MarkerTypeCheckeredFlagRect = 4,<br> MarkerTypeCheckeredFlagCircle = 5,<br> MarkerTypeVerticleCircle = 6,<br> MarkerTypePlaneModel = 7,<br> MarkerTypeLostMCDark = 8,<br> MarkerTypeLostMCLight = 9,<br> MarkerTypeNumber0 = 10,<br> MarkerTypeNumber1 = 11,<br> MarkerTypeNumber2 = 12,<br> MarkerTypeNumber3 = 13,<br> MarkerTypeNumber4 = 14,<br> MarkerTypeNumber5 = 15,<br> MarkerTypeNumber6 = 16,<br> MarkerTypeNumber7 = 17,<br> MarkerTypeNumber8 = 18,<br> MarkerTypeNumber9 = 19,<br> MarkerTypeChevronUpx1 = 20,<br> MarkerTypeChevronUpx2 = 21,<br> MarkerTypeChevronUpx3 = 22,<br> MarkerTypeHorizontalCircleFat = 23,<br> MarkerTypeReplayIcon = 24,<br> MarkerTypeHorizontalCircleSkinny = 25,<br> MarkerTypeHorizontalCircleSkinny_Arrow = 26,<br> MarkerTypeHorizontalSplitArrowCircle = 27,<br> MarkerTypeDebugSphere = 28,<br> MarkerTypeDallorSign = 29,<br> MarkerTypeHorizontalBars = 30,<br> MarkerTypeWolfHead = 31<br>};<br><br>dirX/Y/Z represent a heading on each axis in which the marker should face, alternatively you can rotate each axis independently with rotX/Y/Z (and set dirX/Y/Z all to 0).<br><br>faceCamera - Rotates only the y-axis (the heading) towards the camera<br><br>p19 - no effect, default value in script is 2<br><br>rotate - Rotates only on the y-axis (the heading)<br><br>textureDict - Name of texture dictionary to load texture from (e.g. 'GolfPutting')<br><br>textureName - Name of texture inside dictionary to load (e.g. 'PuttingMarker')<br><br>drawOnEnts - Draws the marker onto any entities that intersect it<br><br>basically what he said, except textureDict and textureName are totally not char*, or if so, then they are always set to 0/NULL/nullptr in every script I checked, eg:<br><br>bj.c: graphics::draw_marker(6, vParam0, 0f, 0f, 1f, 0f, 0f, 0f, 4f, 4f, 4f, 240, 200, 80, iVar1, 0, 0, 2, 0, 0, 0, false);<br><br>his is what I used to draw an amber downward pointing chevron 'V', has to be redrawn every frame.  The 180 is for 180 degrees rotation around the Y axis, the 50 is alpha, assuming max is 100, but it will accept 255.<br><br>GRAPHICS::DRAW_MARKER(2, v.x, v.y, v.z + 2, 0, 0, 0, 0, 180, 0, 2, 2, 2, 255, 128, 0, 50, 0, 1, 1, 0, 0, 0, 0);<br><br>
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">graphics.drawMarker(type, posX, posY, posZ, dirX, dirY, dirZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, colorR, colorG, colorB, alpha, bobUpAndDown, faceCamera, p19, rotate, textureDict, textureName, drawOnEnts);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.graphics.drawMarker(type, posX, posY, posZ, dirX, dirY, dirZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, colorR, colorG, colorB, alpha, bobUpAndDown, faceCamera, p19, rotate, textureDict, textureName, drawOnEnts);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''type:''' int
*'''type:''' int
Line 31: Line 31:
==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

enum MarkerTypes
{
MarkerTypeUpsideDownCone = 0,
MarkerTypeVerticalCylinder = 1,
MarkerTypeThickChevronUp = 2,
MarkerTypeThinChevronUp = 3,
MarkerTypeCheckeredFlagRect = 4,
MarkerTypeCheckeredFlagCircle = 5,
MarkerTypeVerticleCircle = 6,
MarkerTypePlaneModel = 7,
MarkerTypeLostMCDark = 8,
MarkerTypeLostMCLight = 9,
MarkerTypeNumber0 = 10,
MarkerTypeNumber1 = 11,
MarkerTypeNumber2 = 12,
MarkerTypeNumber3 = 13,
MarkerTypeNumber4 = 14,
MarkerTypeNumber5 = 15,
MarkerTypeNumber6 = 16,
MarkerTypeNumber7 = 17,
MarkerTypeNumber8 = 18,
MarkerTypeNumber9 = 19,
MarkerTypeChevronUpx1 = 20,
MarkerTypeChevronUpx2 = 21,
MarkerTypeChevronUpx3 = 22,
MarkerTypeHorizontalCircleFat = 23,
MarkerTypeReplayIcon = 24,
MarkerTypeHorizontalCircleSkinny = 25,
MarkerTypeHorizontalCircleSkinny_Arrow = 26,
MarkerTypeHorizontalSplitArrowCircle = 27,
MarkerTypeDebugSphere = 28,
MarkerTypeDallorSign = 29,
MarkerTypeHorizontalBars = 30,
MarkerTypeWolfHead = 31
};

dirX/Y/Z represent a heading on each axis in which the marker should face, alternatively you can rotate each axis independently with rotX/Y/Z (and set dirX/Y/Z all to 0).

faceCamera - Rotates only the y-axis (the heading) towards the camera

p19 - no effect, default value in script is 2

rotate - Rotates only on the y-axis (the heading)

textureDict - Name of texture dictionary to load texture from (e.g. 'GolfPutting')

textureName - Name of texture inside dictionary to load (e.g. 'PuttingMarker')

drawOnEnts - Draws the marker onto any entities that intersect it

basically what he said, except textureDict and textureName are totally not char*, or if so, then they are always set to 0/NULL/nullptr in every script I checked, eg:

bj.c: graphics::draw_marker(6, vParam0, 0f, 0f, 1f, 0f, 0f, 0f, 4f, 4f, 4f, 240, 200, 80, iVar1, 0, 0, 2, 0, 0, 0, false);

his is what I used to draw an amber downward pointing chevron 'V', has to be redrawn every frame. The 180 is for 180 degrees rotation around the Y axis, the 50 is alpha, assuming max is 100, but it will accept 255.

GRAPHICS::DRAW_MARKER(2, v.x, v.y, v.z + 2, 0, 0, 0, 0, 180, 0, 2, 2, 2, 255, 128, 0, 50, 0, 1, 1, 0, 0, 0, 0);

Syntax

mp.game.graphics.drawMarker(type, posX, posY, posZ, dirX, dirY, dirZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, colorR, colorG, colorB, alpha, bobUpAndDown, faceCamera, p19, rotate, textureDict, textureName, drawOnEnts);

Required Arguments

  • type: int
  • posX: float
  • posY: float
  • posZ: float
  • dirX: float
  • dirY: float
  • dirZ: float
  • rotX: float
  • rotY: float
  • rotZ: float
  • scaleX: float
  • scaleY: float
  • scaleZ: float
  • colorR: int
  • colorG: int
  • colorB: int
  • alpha: int
  • bobUpAndDown: Boolean
  • faceCamera: Boolean
  • p19: int
  • rotate: Boolean
  • textureDict: String
  • textureName: String
  • drawOnEnts: Boolean

Return value

  • Undefined

Example

// todo

See also