From 8182a5f1b6c61bdf95d32a4ad102e1762f0d0924 Mon Sep 17 00:00:00 2001 From: jussi Date: Sun, 20 Feb 2022 20:37:39 +0200 Subject: Documentation and better cmakelist. --- examples/window/main.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 examples/window/main.lua (limited to 'examples/window') diff --git a/examples/window/main.lua b/examples/window/main.lua new file mode 100644 index 0000000..d49d96a --- /dev/null +++ b/examples/window/main.lua @@ -0,0 +1,23 @@ +local textColor = BLACK +local textPos = { 192, 200 } + +function init() + RL_SetWindowTitle( "First window" ) +end + +function process( delta ) + if RL_IsKeyPressed( KEY_ENTER ) then + textColor = BLUE + textPos = { 230, 230 } + end + + if RL_IsKeyPressed( KEY_SPACE ) then + textColor = BLACK + textPos = { 192, 200 } + end +end + +function draw() + RL_ClearBackground( RAYWHITE ); + RL_DrawText( 0, "Congrats! You created your first window!", textPos, 20, 2, textColor ); +end -- cgit v1.2.3