Skip to main content

Graphics::drawSprite

Draws a 2D Sprite / Texture on the screen. This can also be done through DLCPacks.

[Textures & Sprite List](/textures)

Syntax

```js 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

```js if (!mp.game.graphics.hasStreamedTextureDictLoaded("mponmissmarkers")) {

   mp.game.graphics.requestStreamedTextureDict("mponmissmarkers", true);

}

if (mp.game.graphics.hasStreamedTextureDictLoaded("mponmissmarkers")) {

   mp.game.graphics.drawSprite("mponmissmarkers", "capture_the_flag_base_icon", 0.5, 0.5, 0.1, 0.1, 0, 255, 255, 255, 100);

} ```

See also