summaryrefslogtreecommitdiff
path: root/examples/raygui_examples/main.lua
diff options
context:
space:
mode:
authorjussi2023-04-17 17:55:27 +0300
committerjussi2023-04-17 17:55:27 +0300
commit8182c486e64f21c6f95b9108b0e506e603c2a65c (patch)
tree45cb8299fd20e4f6f2cdf761afe8281ac445f035 /examples/raygui_examples/main.lua
parente732b936d4a2c40057eefebed9e6b2e653aeea27 (diff)
downloadreilua-enhanced-8182c486e64f21c6f95b9108b0e506e603c2a65c.tar.gz
reilua-enhanced-8182c486e64f21c6f95b9108b0e506e603c2a65c.tar.bz2
reilua-enhanced-8182c486e64f21c6f95b9108b0e506e603c2a65c.zip
Raygui wrapper examples.
Diffstat (limited to 'examples/raygui_examples/main.lua')
-rw-r--r--examples/raygui_examples/main.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/examples/raygui_examples/main.lua b/examples/raygui_examples/main.lua
new file mode 100644
index 0000000..844ad39
--- /dev/null
+++ b/examples/raygui_examples/main.lua
@@ -0,0 +1,44 @@
+package.path = package.path..";"..RL.GetBasePath().."?.lua"
+package.path = package.path..";"..RL.GetBasePath().."../resources/lib/?.lua"
+
+
+Util = require( "utillib" )
+Rect = require( "rectangle" )
+Vec2 = require( "vector2" )
+Color = require( "color" )
+Raygui = require( "raygui" )
+Calculator = require( "calculator" )
+
+local calculator = nil
+local calculator2 = nil
+
+function RL.init()
+ local monitor = 0
+ local mPos = Vec2:new( RL.GetMonitorPosition( monitor ) )
+ local mSize = Vec2:new( RL.GetMonitorSize( monitor ) )
+ local winSize = Vec2:new( 1024, 800 )
+
+ RL.SetWindowTitle( "Raygui examples" )
+ RL.SetWindowState( RL.FLAG_WINDOW_RESIZABLE )
+ RL.SetWindowState( RL.FLAG_VSYNC_HINT )
+ RL.SetWindowSize( winSize )
+ RL.SetWindowPosition( { mPos.x + mSize.x / 2 - winSize.x / 2, mPos.y + mSize.y / 2 - winSize.y / 2 } )
+
+ RL.GuiSetStyle( RL.DEFAULT, RL.TEXT_SIZE, 20 )
+ RL.GuiSetStyle( RL.DEFAULT, RL.TEXT_SPACING, 4 )
+
+ calculator = Calculator:new( Vec2:new( 32, 32 ) )
+ calculator2 = Calculator:new( Vec2:new( 64, 65 ) )
+end
+
+function RL.process( delta )
+ -- Gui:process()
+ Raygui:process()
+end
+
+function RL.draw()
+ RL.ClearBackground( RL.DARKBLUE )
+
+ -- Gui:draw()
+ Raygui:draw()
+end