From 7b9bbbba968d26498d26d5e60ad166051e310ff9 Mon Sep 17 00:00:00 2001 From: Milan Nikolic Date: Wed, 23 Mar 2022 14:09:10 +0100 Subject: [PATCH] Add DrawTextureTiled, fixes #170 --- raylib/rtextures.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/raylib/rtextures.go b/raylib/rtextures.go index 039d0e6..5010a86 100644 --- a/raylib/rtextures.go +++ b/raylib/rtextures.go @@ -632,3 +632,15 @@ func DrawTexturePro(texture Texture2D, sourceRec, destRec Rectangle, origin Vect ctint := colorCptr(tint) C.DrawTexturePro(*ctexture, *csourceRec, *cdestRec, *corigin, crotation, *ctint) } + +// DrawTextureTiled - Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest +func DrawTextureTiled(texture Texture2D, sourceRec, destRec Rectangle, origin Vector2, rotation float32, scale float32, tint color.RGBA) { + ctexture := texture.cptr() + csourceRec := sourceRec.cptr() + cdestRec := destRec.cptr() + corigin := origin.cptr() + crotation := (C.float)(rotation) + cscale := (C.float)(scale) + ctint := colorCptr(tint) + C.DrawTextureTiled(*ctexture, *csourceRec, *cdestRec, *corigin, crotation, cscale, *ctint) +}