summaryrefslogtreecommitdiff
path: root/examples/window/main.lua
blob: d49d96ab6797d3bec28f1beb0e86dbd4cd4d2e05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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