diff --git a/raylib/rtextures.go b/raylib/rtextures.go index 0068c62..4e008c0 100644 --- a/raylib/rtextures.go +++ b/raylib/rtextures.go @@ -282,6 +282,15 @@ func ImageCopy(image *Image) *Image { return v } +// Create an image from another image piece +func ImageFromImage(image Image, rec Rectangle) Image { + cimage := image.cptr() + crec := rec.cptr() + ret := C.ImageFromImage(*cimage, *crec) + v := newImageFromPointer(unsafe.Pointer(&ret)) + return *v +} + // ImageText - Create an image from text (default font) func ImageText(text string, fontSize int32, col color.RGBA) *Image { ctext := C.CString(text)