Перейти к содержанию

Graphics::drawSprite

Материал из RAGE MP Wiki Archive
Версия от 16:19, 27 июля 2018; imported>Stuyk
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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

Textures & Sprite List

Syntax

<syntaxhighlight lang="javascript">mp.game.graphics.drawSprite(textureDict, textureName, screenX, screenY, scaleX, scaleY, heading, colorR, colorG, colorB, alpha);</syntaxhighlight>

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

<syntaxhighlight lang="javascript"> 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);

} </syntaxhighlight>

See also