summaryrefslogtreecommitdiff
path: root/examples/image_draw
diff options
context:
space:
mode:
authorjussi2022-05-04 23:11:09 +0300
committerjussi2022-05-04 23:11:09 +0300
commitb034aa01dc0ca443eba7c7b12ead7732c3e32240 (patch)
tree42c3ff4ddd36427fd0f1e0bb1d9c9491b095e6ea /examples/image_draw
parented4636fa812e64c5391ee9f408092990f33277b4 (diff)
downloadreilua-enhanced-b034aa01dc0ca443eba7c7b12ead7732c3e32240.tar.gz
reilua-enhanced-b034aa01dc0ca443eba7c7b12ead7732c3e32240.tar.bz2
reilua-enhanced-b034aa01dc0ca443eba7c7b12ead7732c3e32240.zip
Image manipulation functions.
Diffstat (limited to 'examples/image_draw')
-rw-r--r--examples/image_draw/main.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/image_draw/main.lua b/examples/image_draw/main.lua
index 8855fce..5490c94 100644
--- a/examples/image_draw/main.lua
+++ b/examples/image_draw/main.lua
@@ -2,6 +2,8 @@ local monitor = 0
local texture = -1
local image = -1
local catImage = -1
+local catCopy = -1
+local textImage = -1
function init()
local mPos = RL_GetMonitorPosition( monitor )
@@ -21,6 +23,17 @@ function init()
RL_ImageDraw( image, catImage, { 143, 25, 230, 250 }, { 200, 200, 230, 250 }, WHITE )
RL_ImageDrawTextEx( image, 0, "Hello", { 300, 32 }, 48.0, 1.0, WHITE )
+ -- catCopy = RL_ImageCopy( catImage )
+ local src = { 80, 70, 96, 96 }
+ catCopy = RL_ImageFromImage( catImage, src )
+
+ RL_ImageDraw( image, catCopy, src, { 600, 200, src[3], src[4] }, WHITE )
+ -- RL_ImageDraw( image, catCopy, src, src, WHITE )
+
+ textImage = RL_ImageText( 0, "Cat", 10, 4, WHITE )
+ local imageSize = RL_GetImageSize( textImage )
+ RL_ImageDraw( image, textImage, { 0, 0, imageSize[1], imageSize[2] }, { 250, 40, imageSize[1], imageSize[2] }, WHITE )
+
texture = RL_LoadTextureFromImage( image )
end