From 79fbb36d2a4d73001c446f75b3b87dc84f1605b6 Mon Sep 17 00:00:00 2001 From: jussi Date: Wed, 7 Dec 2022 22:27:24 +0200 Subject: ReiLuaGui calculator example. --- examples/ReiLuaGui/main.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'examples/ReiLuaGui') diff --git a/examples/ReiLuaGui/main.lua b/examples/ReiLuaGui/main.lua index 240e76e..9890646 100644 --- a/examples/ReiLuaGui/main.lua +++ b/examples/ReiLuaGui/main.lua @@ -10,6 +10,7 @@ local container = {} -- local circleTexture = RL_LoadTexture( RL_GetBasePath().."../resources/images/circle.png" ) local circleTexture = RL_LoadTexture( RL_GetBasePath().."../resources/images/plain-circle.png" ) local checkTexture = RL_LoadTexture( RL_GetBasePath().."../resources/images/check-mark.png" ) +local borderTexture = RL_LoadTexture( RL_GetBasePath().."../resources/images/ui_border.png" ) local textInput RL_GenTextureMipmaps( circleTexture ) @@ -29,8 +30,8 @@ function initGui() -- HAling = Gui.ALING.CENTER, -- type = Gui.CONTAINER.HORIZONTAL, -- VAling = Gui.ALING.CENTER, - type = Gui.CONTAINER.GRID, - columns = 2, + -- type = Gui.CONTAINER.GRID, + -- columns = 2, -- rows = 2, scrollable = true, showScrollbar = true, @@ -50,6 +51,16 @@ function initGui() } ) dog:add( Gui.text:new( { text = "Dog", HAling = Gui.ALING.LEFT } ) ) + + dog:add( Gui.texture:new( { + bounds = dog.bounds:clone(), + texture = borderTexture, + HAling = Gui.ALING.CENTER, + VAling = Gui.ALING.CENTER, + visible = true, + nPatchInfo = { source = { 0, 0, 24, 24 }, left = 8, top = 8, right = 8, bottom = 8, layout = NPATCH_NINE_PATCH }, + } ) ) + dog:add( Gui.texture:new( { bounds = Rect:new( 0, 0, 24, 24 ), texture = circleTexture, HAling = Gui.ALING.RIGHT, color = Color:new( 150, 150, 255 ) } ) ) dog:add( Gui.texture:new( { bounds = Rect:new( 0, 0, 24, 24 ), texture = checkTexture, HAling = Gui.ALING.RIGHT, visible = true } ) ) -- dog:add( Gui.text:new( { text = "Cat", HAling = Gui.ALING.RIGHT } ) ) -- cgit v1.2.3