Skip to content

raylib.DrawTexturePro

JoeStrout edited this page Nov 16, 2026 · 3 revisions

Draw a part of a texture (source rectangle) into a destination rectangle, with origin and rotation (degrees). NOTE: origin is relative to the destination rectangle

Parameters

Parameter Default Value Note
texture
source
dest
origin [0, 0]
rotation 0
tint WHITE

Return value

None.

Notes

Example

tex = raylib.LoadTexture("sprite.png")
src = {x:0, y:0, width:64, height:64}
dst = {x:100, y:100, width:128, height:128}
raylib.BeginDrawing
  raylib.ClearBackground raylib.BLACK
  raylib.DrawTexturePro tex, src, dst, [0, 0], 0, raylib.WHITE
raylib.EndDrawing
raylib.UnloadTexture tex

Clone this wiki locally