GraphicsClient

drawSprite

DRAW_SPRITE0xE7FFAE5EBF23D890

The GTA V native DRAW_SPRITE of the GRAPHICS namespace, as LS:MP client scripts call it: the global function drawSprite, in JavaScript and in Lua.

SignatureJavaScript
drawSprite(
  textureDict: string,
  textureName: string,
  screenX: number,
  screenY: number,
  width: number,
  height: number,
  heading: number,
  red: number,
  green: number,
  blue: number,
  alpha: number,
  p11: boolean,
  p12: any
): void
SignatureLua
drawSprite(
  textureDict: string,
  textureName: string,
  screenX: number,
  screenY: number,
  width: number,
  height: number,
  heading: number,
  red: integer,
  green: integer,
  blue: integer,
  alpha: integer,
  p11: boolean,
  p12: any
)

Usage

JavaScript
drawSprite(
  textureDict, textureName, screenX, screenY, width, height, heading, red, green, blue, alpha,
  p11, p12
);
Lua
drawSprite(
    textureDict, textureName, screenX, screenY, width, height, heading, red, green, blue, alpha,
    p11, p12
)

Parameters

ParameterTypeJavaScriptLua
textureDictstringstringstring
textureNamestringstringstring
screenXfloatnumbernumber
screenYfloatnumbernumber
widthfloatnumbernumber
heightfloatnumbernumber
headingfloatnumbernumber
redintnumberinteger
greenintnumberinteger
blueintnumberinteger
alphaintnumberinteger
p11BOOLbooleanboolean
p12Anyanyany

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

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 - opacity level

Reference

Namespace
Graphics GRAPHICS
In the game
void DRAW_SPRITE(const char* textureDict, const char* textureName, float screenX, float screenY, float width, float height, float heading, int red, int green, int blue, int alpha, BOOL p11, Any p12)
Hash
0xE7FFAE5EBF23D890

Open in the interactive natives reference