# GRAPHICS::DRAW_SPRITE

- **Hash:** `0xC9884ECADE94CB34`
- **Namespace:** GRAPHICS
- **Runtime name (Lua/JS):** `DrawSprite`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/GRAPHICS/DRAW_SPRITE

## Signature

```c
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);
```

## Parameters

- `textureDict` (`const char*`)
- `textureName` (`const char*`)
- `screenX` (`float`)
- `screenY` (`float`)
- `width` (`float`)
- `height` (`float`)
- `heading` (`float`)
- `red` (`int`)
- `green` (`int`)
- `blue` (`int`)
- `alpha` (`int`)
- `p11` (`BOOL`)

## Returns

`void`

## Description

Draws a 2D sprite on the screen.

Parameters:
textureDict - Name of texture dictionary to load texture from

textureName - Name of texture to load from texture dictionary

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

https://github.com/femga/rdr3_discoveries/tree/master/useful_info_from_rpfs/textures

## Usage

### Lua

```lua
DrawSprite(textureDict, textureName, screenX, screenY, width, height, heading, red, green, blue, alpha, p11)

-- always available, by hash
Citizen.InvokeNative(0xC9884ECADE94CB34, textureDict, textureName, screenX, screenY, width, height, heading, red, green, blue, alpha, p11)
```

### JavaScript

```js
DrawSprite(textureDict, textureName, screenX, screenY, width, height, heading, red, green, blue, alpha, p11);

// by hash
Citizen.invokeNative('0xC9884ECADE94CB34', textureDict, textureName, screenX + 0.0000001, screenY + 0.0000001, width + 0.0000001, height + 0.0000001, heading + 0.0000001, red, green, blue, alpha, p11);
```

### C#

```csharp
Function.Call((Hash)0xC9884ECADE94CB34, textureDict, textureName, screenX, screenY, width, height, heading, red, green, blue, alpha, p11);
```

- Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason.

*Sources: alloc8or RDR3 NativeDB.*
