All global variables and functions are not in global RL table. doc_parser creates also ReiLua_API.lua.

This commit is contained in:
jussi
2023-04-06 12:31:37 +03:00
parent 198a74c0aa
commit 2526c9732e
47 changed files with 8730 additions and 3196 deletions

View File

@@ -1,29 +1,29 @@
local textColor = BLACK
local textColor = RL.BLACK
local textPos = { 192, 200 }
local imageFont = -1
local text = "Congrats! You created your first window!"
function init()
RL_SetWindowTitle( "First window" )
RL_SetWindowState( FLAG_VSYNC_HINT )
function RL.init()
RL.SetWindowTitle( "First window" )
RL.SetWindowState( RL.FLAG_VSYNC_HINT )
end
function process( delta )
if RL_IsKeyPressed( KEY_ENTER ) then
local textSize = RL_MeasureText( 0, text, 20, 2 )
local winSize = RL_GetScreenSize()
function RL.process( delta )
if RL.IsKeyPressed( RL.KEY_ENTER ) then
local textSize = RL.MeasureText( 0, text, 20, 2 )
local winSize = RL.GetScreenSize()
textColor = BLUE
textColor = RL.BLUE
textPos = { winSize[1] / 2 - textSize[1] / 2, winSize[2] / 2 - textSize[2] / 2 }
end
if RL_IsKeyPressed( KEY_SPACE ) then
textColor = BLACK
if RL.IsKeyPressed( RL.KEY_SPACE ) then
textColor = RL.BLACK
textPos = { 192, 200 }
end
end
function draw()
RL_ClearBackground( RAYWHITE )
RL_DrawText( 0, text, textPos, 20, 2, textColor )
function RL.draw()
RL.ClearBackground( RL.RAYWHITE )
RL.DrawText( 0, text, textPos, 20, 2, textColor )
end