Graphics::drawSprite: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(yay)
Line 1: Line 1:
Draws a 2D sprite on the screen.<br><br>Parameters:<br>textureDict - Name of texture dictionary to load texture from (e.g. 'CommonMenu', 'MPWeaponsCommon', etc.)<br><br>textureName - Name of texture to load from texture dictionary (e.g. 'last_team_standing_icon', 'tennis_icon', etc.)<br><br>screenX/Y - Screen offset (0.5 = center)<br>scaleX/Y - Texture scaling. Negative values can be used to flip the texture on that axis. (0.5 = half)<br><br>heading - Texture rotation in degrees (default = 0.0) positive is clockwise, measured in degrees<br><br>red,green,blue - Sprite color (default = 255/255/255)<br><br>alpha - if set to '2' it will grab all entitys in the game on call<br><br>alpha - why would it do that and where would it output the entites. And shouldn't it the alpha color for this param?
Draws a 2D sprite on the screen.<br><br>Parameters:<br>textureDict - Name of texture dictionary to load texture from (e.g. 'CommonMenu', 'MPWeaponsCommon', etc.)<br><br>textureName - Name of texture to load from texture dictionary (e.g. 'last_team_standing_icon', 'tennis_icon', etc.)<br><br>screenX/Y - Screen offset (0.5 = center)<br>scaleX/Y - Texture scaling. Negative values can be used to flip the texture on that axis. (0.5 = half)<br><br>heading - Texture rotation in degrees (default = 0.0) positive is clockwise, measured in degrees<br><br>red,green,blue - Sprite color (default = 255/255/255)<br><br>alpha - if set to '2' it will grab all entitys in the game on call<br><br>alpha - why would it do that and where would it output the entites. And shouldn't it the alpha color for this param?
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">graphics.drawSprite(textureDict, textureName, screenX, screenY, scaleX, scaleY, heading, colorR, colorG, colorB, alpha);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.graphics.drawSprite(textureDict, textureName, screenX, screenY, scaleX, scaleY, heading, colorR, colorG, colorB, alpha);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''textureDict:''' String
*'''textureDict:''' String
Line 18: Line 18:
==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:27, 6 May 2017

Draws a 2D sprite on the screen.

Parameters:
textureDict - Name of texture dictionary to load texture from (e.g. 'CommonMenu', 'MPWeaponsCommon', etc.)

textureName - Name of texture to load from texture dictionary (e.g. 'last_team_standing_icon', 'tennis_icon', etc.)

screenX/Y - Screen offset (0.5 = center)
scaleX/Y - Texture scaling. Negative values can be used to flip the texture on that axis. (0.5 = half)

heading - Texture rotation in degrees (default = 0.0) positive is clockwise, measured in degrees

red,green,blue - Sprite color (default = 255/255/255)

alpha - if set to '2' it will grab all entitys in the game on call

alpha - why would it do that and where would it output the entites. And shouldn't it the alpha color for this param?

Syntax

mp.game.graphics.drawSprite(textureDict, textureName, screenX, screenY, scaleX, scaleY, heading, colorR, colorG, colorB, alpha);

Required Arguments

  • textureDict: String
  • textureName: String
  • screenX: float
  • screenY: float
  • scaleX: float
  • scaleY: float
  • heading: float
  • colorR: int
  • colorG: int
  • colorB: int
  • alpha: int

Return value

  • Undefined

Example

// todo

See also