-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.DrawTextureRec
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Draw a part of a texture (defined by a rectangle)
| Parameter | Default Value | Note |
|---|---|---|
| texture | ||
| source | ||
| position | [0, 0] | |
| tint | WHITE |
None.
tex = raylib.LoadTexture("spritesheet.png")
// Draw just the first 64x64 frame at position [0, 0]
src = {x:0, y:0, width:64, height:64}
raylib.BeginDrawing
raylib.ClearBackground raylib.BLACK
raylib.DrawTextureRec tex, src, [0, 0], raylib.WHITE
raylib.EndDrawing
raylib.UnloadTexture tex