Skip to content

raylib.DrawTextureRec

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Draw a part of a texture (defined by a rectangle)

Parameters

Parameter Default Value Note
texture
source
position [0, 0]
tint WHITE

Return value

None.

Notes

Example

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

Clone this wiki locally