From 3090134068e99e73ca57e8c0b62534c9bc99e93b Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Fri, 7 Nov 2025 04:55:35 +0530 Subject: Changes Docs Folders --- html_docs/manual.html | 2144 ------------------------------------------------- 1 file changed, 2144 deletions(-) delete mode 100644 html_docs/manual.html (limited to 'html_docs/manual.html') diff --git a/html_docs/manual.html b/html_docs/manual.html deleted file mode 100644 index 5cae8e5..0000000 --- a/html_docs/manual.html +++ /dev/null @@ -1,2144 +0,0 @@ -
> A modified version of ReiLua with embedded main.lua, embedded assets, splash screens, and asset loading system
-This is an enhanced version of ReiLua featuring:
-ReiLua brings the power and simplicity of Raylib to the beginner-friendly Lua language in a straightforward manner. It is a loose binding to Raylib - some functions are excluded and some are added. The concept of pointing to a "main.lua" file and accessing functions "init", "update", and "draw" is borrowed from the Löve game framework.
-Note: ReiLua is lovingly handcrafted and will likely contain bugs and documentation errors, so it would be much appreciated if you would report any such findings. -Reilua means "fair" in Finnish. -This enhanced version is built upon:
-ReiLua is WIP and some planned raylib functionality is still missing, but it already has over 1000 functions. Current Raylib version is 5.5.
-List of some MISSING features that are planned to be included:
-Development Mode (Fast Iteration):
-# 1. Create your game files
-GameFolder/
-├── main.lua
-├── assets/
-│ ├── player.png
-│ └── music.wav
-
-# 2. Run ReiLua pointing to your game folder
-ReiLua.exe GameFolder/
-
-# Or from your game folder
-cd GameFolder
-path/to/ReiLua.exe
-
-# Skip splash screens during development
-ReiLua.exe --no-logo
-
-# Enable console for debugging
-ReiLua.exe --log --no-logo
-
-Release Mode (Single Executable):
-# See "Building for Release" section below
-
-Create a main.lua file:
local textColor = RL.BLACK
-local textPos = { 192, 200 }
-local textSize = 20
-local text = "Congrats! You created your first window!"
-
-function RL.init()
- RL.SetWindowTitle( "First window" )
- RL.SetWindowState( RL.FLAG_VSYNC_HINT )
-end
-
-function RL.update( delta )
- if RL.IsKeyPressed( RL.KEY_ENTER ) then
- local winSize = RL.GetScreenSize()
- local measuredSize = RL.MeasureTextEx( RL.GetFontDefault(), text, textSize, 2 )
-
- textColor = RL.BLUE
- textPos = { winSize[1] / 2 - measuredSize[1] / 2, winSize[2] / 2 - measuredSize[2] / 2 }
- end
-
- if RL.IsKeyPressed( RL.KEY_SPACE ) then
- textColor = RL.RED
- textPos = { 192, 200 }
- end
-end
-
-function RL.draw()
- RL.ClearBackground( RL.RAYWHITE )
- RL.DrawText( text, textPos, textSize, textColor )
-end
-
-Run it:
-ReiLua.exe --no-logo
-
-ReiLua looks for a 'main.lua' or 'main' file as the entry point. There are seven Lua functions that the framework will call:
-RL.init() - Called once at startup for initializationRL.update(delta) - Called every frame before draw, receives delta timeRL.draw() - Called every frame for renderingRL.event(event) - Called when events occurRL.log(logLevel, message) - Called for loggingRL.exit() - Called when the application is closingRL.config() - ⚠️ Deprecated in this versionAll functionality can be found in "API.md".
-This version includes customizable splash screens that display at startup:
-Screen 1: Custom text - Bold text on Raylib red background (customizable) -Screen 2: "Made using" - Displays Raylib and ReiLua logos side-by-side -Each screen fades in (0.8s), displays (2.5s), and fades out (0.8s) for a total of ~8 seconds.
-Skip During Development:
-ReiLua.exe --no-logo
-
-Customize:
-src/splash.clogo/ foldersrc/splash.cSee SPLASH_SCREENS.md for full documentation.
-Beautiful loading screen with progress tracking:
-function RL.init()
- -- List your assets
- local assets = {
- "assets/player.png",
- "assets/enemy.png",
- "assets/background.png",
- "assets/music.wav",
- }
-
- -- Start loading with progress
- RL.BeginAssetLoading(#assets)
-
- -- Load each asset
- for i, path in ipairs(assets) do
- RL.UpdateAssetLoading(path)
-
- -- Your loading code
- if path:match("%.png$") then
- textures[i] = RL.LoadTexture(path)
- elseif path:match("%.wav$") then
- sounds[i] = RL.LoadSound(path)
- end
- end
-
- -- Finish loading
- RL.EndAssetLoading()
-end
-
-Features:
-See ASSET_LOADING.md for full documentation.
-Bundle all your Lua code into the executable for easy distribution:
-# Copy Lua files to build directory
-cd build
-copy ..\your_game\*.lua .
-
-# Build with embedding
-cmake .. -DEMBED_MAIN=ON
-cmake --build . --config Release
-
-Result: Single executable with all Lua code embedded!
-Package images, sounds, fonts, and other assets into your executable:
-# Create assets folder and copy files
-cd build
-mkdir assets
-copy ..\your_game\assets\* assets\
-
-# Build with embedding
-cmake .. -DEMBED_ASSETS=ON
-cmake --build . --config Release
-
-Your Lua code doesn't change! Use the same paths:
--- Works in both development and release
-playerImg = RL.LoadTexture("assets/player.png")
-music = RL.LoadSound("assets/music.wav")
-
-See EMBEDDING.md for full documentation.
-By default, ReiLua runs without a console window for a clean user experience. Enable it for debugging:
-# Show console for debugging
-ReiLua.exe --log
-
-# Combine with other options
-ReiLua.exe --log --no-logo
-ReiLua.exe --log path/to/game
-
-This shows:
-One-command builds for development and release:
-Development Build (Fast Iteration):
-# Windows
-scripts\build_dev.bat
-
-# Linux/Unix
-chmod +x scripts/build_dev.sh
-scripts/build_dev.sh
-
-Release Build (Distribution):
-# Prepare files first
-cd build
-copy ..\your_game\*.lua .
-mkdir assets
-copy ..\your_game\assets\* assets\
-
-# Build release
-cd ..
-
-# Windows
-scripts\build_release.bat
-
-# Linux/Unix
-scripts/build_release.sh
-
-See BUILD_SCRIPTS.md for full documentation.
-ReiLua [Options] [Directory to main.lua or main]
-
-Options:
- -h, --help Show help message
- -v, --version Show ReiLua version
- -i, --interpret Interpret mode [File name]
- --log Show console window for logging (Windows only)
- --no-logo Skip splash screens (development)
-
-# Run game in current directory
-ReiLua.exe
-
-# Run game in specific folder
-ReiLua.exe path/to/game/
-
-# Development mode (no splash, with console)
-ReiLua.exe --log --no-logo
-
-# Interpreter mode (run single script)
-ReiLua.exe -i script.lua
-
-# Show help
-ReiLua.exe --help
-
-# Show version
-ReiLua.exe --version
-
-Some objects allocate memory that needs to be freed when no longer needed. By default, objects like Textures are unloaded by the Lua garbage collector. However, it's generally recommended to handle this manually in more complex projects:
-RL.SetGCUnload()
-
-ReiLua can run single Lua files using interpreter mode:
-ReiLua -i hello.lua
-
-The given file will be called with dofile.
Generate API.md and ReiLua_API.lua from the build folder:
-ReiLua -i ../tools/docgen.lua
-
-Tip: Use tools/ReiLua_API.lua in your project folder to provide annotations when using "Lua Language Server".
-You'll need to statically link Raylib and Lua to create the executable. This simplifies distribution, especially on Linux where different distros use different library versions.
-# Download Raylib source
-# Run w64devkit.exe and navigate to raylib/src
-cd raylib/src
-mingw32-make
-
-# Copy libraylib.a to ReiLua/lib folder
-copy libraylib.a path\to\ReiLua\lib\
-
-Download Lua source from https://github.com/lua/lua
-Modify Lua's makefile:
-# Change this:
-MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -DLUA_USE_READLINE
-# To this:
-MYCFLAGS= $(LOCAL) -std=c99
-
-# Comment out or remove:
-MYLIBS= -ldl -lreadline
-
-Build:
-# In w64devkit, navigate to Lua folder
-mingw32-make
-
-# Copy liblua.a to ReiLua/lib folder
-copy liblua.a path\to\ReiLua\lib\
-
-Quick Method (Recommended):
-cd ReiLua
-scripts\build_dev.bat
-
-Manual Method:
-cd ReiLua\build
-cmake -G "MinGW Makefiles" ..
-mingw32-make
-
-cd build
-ReiLua.exe ..\examples\snake\
-
-If you see a low-res snake racing off the window, success! Press Enter to reset.
-sudo apt install build-essential cmake
-
-Compile Raylib and Lua by following their instructions. They will compile to libraylib.a and liblua.a by default.
Move both .a files to the ReiLua/lib folder.
Quick Method (Recommended):
-cd ReiLua
-chmod +x scripts/build_dev.sh
-scripts/build_dev.sh
-
-Manual Method:
-cd ReiLua/build
-cmake ..
-make
-
-./ReiLua ../examples/snake/
-
-Not tested, but should work similarly to Linux.
-Works best when Raylib is compiled using PLATFORM=DRM. See Raylib build instructions for Raspberry Pi.
Compile ReiLua with:
-cmake .. -DDRM=ON
-
-Note: DRM should be launched from CLI, not in X.
-Compile Raylib for web following its instructions: https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)
-Modify Lua's makefile:
-# Change:
-MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -DLUA_USE_READLINE
-# To:
-MYCFLAGS= $(LOCAL) -std=c99
-
-# Change:
-MYLIBS= -ldl -lreadline
-# To:
-MYLIBS= -ldl
-
-# Change:
-CC= gcc
-# To:
-CC= emcc
-
-# Change:
-CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common -march=native
-# To:
-CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common
-
-# Change:
-AR= ar rc
-# To:
-AR= emar
-
-# Change:
-$(AR) $@ $?
-# To:
-$(AR) rcs $@ $?
-
-Build with make if emsdk environmental variables are correct.
Put libraylib.a and liblua.a into ReiLua/lib/web/.
cd ReiLua/build
-mkdir resources
-# Copy main.lua to resources/
-# Copy assets to resources/
-
-Structure:
-ReiLua/
-└── build/
- └── resources/
- ├── main.lua
- └── assets/
-
-cd build
-cmake .. -DCMAKE_TOOLCHAIN_FILE=/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DPLATFORM=Web
-make
-
-python -m http.server 8080
-
-Access in browser: localhost:8080/ReiLua.html
MyGame/
-├── main.lua
-├── player.lua
-├── enemy.lua
-├── assets/
-│ ├── player.png
-│ ├── enemy.png
-│ └── music.wav
-
-cd ReiLua/build
-
-# Copy all Lua files
-copy ..\MyGame\*.lua .
-
-# Copy assets
-mkdir assets
-copy ..\MyGame\assets\* assets\
-# Or: xcopy /E /I ..\MyGame\assets assets
-
-cd ..
-scripts\build_release.bat
-# Or: scripts/build_release.sh on Linux
-
-cd build
-ReiLua.exe --log
-
-Verify:
-mkdir Distribution
-copy ReiLua.exe Distribution\YourGameName.exe
-
-Your game is now a single executable ready for distribution!
-Edit CMakeLists.txt:
project( YourGameName ) # Change from "ReiLua"
-
-Replace icon.ico with your own icon file, then rebuild.
Edit resources.rc:
VALUE "CompanyName", "Your Studio Name"
-VALUE "FileDescription", "Your Game Description"
-VALUE "ProductName", "Your Game Name"
-VALUE "LegalCopyright", "Copyright (C) Your Name, 2025"
-
-Edit src/splash.c:
const char* text = "YOUR STUDIO NAME"; // Change this
-
-Replace logos:
-# Replace these files before building
-logo/raylib_logo.png
-logo/reilua_logo.png
-
-Zed is a modern, high-performance code editor. Here's how to set it up for ReiLua development:
-Download from: https://zed.dev/
-1. Open Zed 2. Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux) 3. Type "install language server" and select Lua 4. Zed will automatically install the Lua Language Server
Create .zed/settings.json in your project root:
{
- "lsp": {
- "lua-language-server": {
- "settings": {
- "Lua": {
- "runtime": {
- "version": "Lua 5.4"
- },
- "diagnostics": {
- "globals": ["RL"]
- },
- "workspace": {
- "library": ["ReiLua_API.lua"]
- }
- }
- }
- }
- },
- "languages": {
- "Lua": {
- "format_on_save": "on",
- "formatter": "language_server"
- }
- }
-}
-
-Copy tools/ReiLua_API.lua to your project folder. This provides autocomplete and documentation for all ReiLua functions.
copy path\to\ReiLua\tools\ReiLua_API.lua your_game\
-
-Useful Zed shortcuts for Lua development:
-Ctrl+P / Cmd+P - Quick file searchCtrl+Shift+F / Cmd+Shift+F - Search in filesCtrl+. / Cmd+. - Code actionsF12 - Go to definitionShift+F12 - Find referencesCtrl+Space - Trigger autocompleteInstall useful extensions: 1. Press Ctrl+Shift+X / Cmd+Shift+X 2. Search and install:
Create a workspace for ReiLua projects:
-1. Open your game folder in Zed 2. File → Add Folder to Workspace 3. Add the ReiLua source folder (for reference) 4. File → Save Workspace As...
-This lets you easily reference ReiLua source while developing your game.
-For debugging Lua code with Zed:
-1. Use print() statements liberally 2. Run ReiLua with --log flag to see output 3. Use RL.TraceLog() for more detailed logging:
RL.TraceLog(RL.LOG_INFO, "Player position: " .. x .. ", " .. y)
-RL.TraceLog(RL.LOG_WARNING, "Low health!")
-RL.TraceLog(RL.LOG_ERROR, "Failed to load asset!")
-
-Run ReiLua directly from Zed's terminal:
-1. Press ` Ctrl+ ` / Cmd+ ` to open terminal 2. Run your game:
path\to\ReiLua.exe --log --no-logo
-
-1. Use Multiple Cursors: Alt+Click to add cursors, great for batch edits 2. Split Views: Ctrl+\ to split editor for side-by-side editing 3. Symbol Search: Ctrl+T / Cmd+T to search for functions 4. Zen Mode: Ctrl+K Z for distraction-free coding 5. Live Grep: Ctrl+Shift+F to search across all files
Game doesn't start:
- to see error messages existsAssets not loading:
- to see loading errorsSplash screens don't show:
- flagLua files not embedded:
- directory before building exists was usedAssets not embedded:
- folder was usedBuild fails:
- and liblua.a are in lib/ folder1. Check documentation files listed above 2. Review the examples in examples/ folder 3. Use --log` flag to see detailed error messages 4. Check your file paths and directory structure
Contributions are welcome! This is an enhanced version with additional features. When contributing:
-1. Test thoroughly with both development and release builds 2. Update documentation if adding features 3. Follow existing code style 4. Test on multiple platforms if possible
-ReiLua is licensed under the zlib/libpng license. See LICENSE file for details.
----
-Happy Game Development!
-When you're ready to ship your game, you can embed all Lua files and asset files directly into the executable.
-Development Build (Fast Iteration)
-During development, use external files for quick iteration.
-Setup:
-GameFolder/
-├── ReiLua.exe
-├── main.lua
-├── player.lua
-└── assets/
- ├── player.png
- └── music.wav
-
-Build:
-cd build
-cmake ..
-cmake --build .
-
-Benefits:
---log flagRelease Build (Single Executable)
-For distribution, embed everything into one file.
-Setup:
-cd build
-
-# Copy Lua files to build directory
-copy ..\main.lua .
-copy ..\player.lua .
-
-# Create assets folder and copy files
-mkdir assets
-copy ..\player.png assets\
-copy ..\music.wav assets\
-
-Build:
-# Configure with embedding
-cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON
-
-# Build release
-cmake --build . --config Release
-
-Result:
-Distribution/
-└── YourGame.exe (Everything embedded!)
-
-Benefits:
-1. Copy your Lua files to the build directory:
- copy main.lua build\main.lua
- copy player.lua build\player.lua
-
-2. Build with EMBED_MAIN option:
- cd build
- cmake .. -DEMBED_MAIN=ON
- cmake --build . --config Release
-
-ReiLua supports several command-line options:
-ReiLua [Options] [Directory to main.lua or main]
-
-Options:
- -h, --help Show help message
- -v, --version Show ReiLua version
- -i, --interpret Interpret mode [File name]
- --log Show console window for logging (Windows only)
-
-By default, ReiLua runs without a console window for a clean user experience. To enable console output for debugging:
-# Run with console for debugging
-ReiLua.exe --log
-
-# You can also combine with other options
-ReiLua.exe --log path/to/game
-
-# Or with interpret mode
-ReiLua.exe --log -i script.lua
-
-This is useful during development to see:
-Here's a complete step-by-step guide to prepare your game for release:
-Ensure your project has this structure:
-MyGame/
-├── main.lua
-├── player.lua
-├── enemy.lua
-├── player.png
-├── enemy.png
-├── music.wav
-└── icon.ico (optional)
-
-Change executable icon:
-# Replace ReiLua's icon with yours
-copy MyGame\icon.ico ReiLua\icon.ico
-
-Edit executable properties: Open ReiLua\resources.rc and modify:
VALUE "CompanyName", "Your Studio Name"
-VALUE "FileDescription", "Your Game Description"
-VALUE "ProductName", "Your Game Name"
-VALUE "LegalCopyright", "Copyright (C) Your Name, 2025"
-
-Change executable name: Edit ReiLua\CMakeLists.txt:
project( YourGameName ) # Change from "ReiLua"
-
-See CUSTOMIZATION.md for full details.
-assets/ prefix, so use the same paths in both development and release:
--- Correct - works in both dev and release
-playerImage = RL.LoadTexture("assets/player.png")
-backgroundImg = RL.LoadTexture("assets/background.png")
-musicSound = RL.LoadSound("assets/music.wav")
-
-Your Lua code doesn't need to change between development and release builds!
-cd ReiLua\build
-
-# Copy all Lua files
-copy ..\MyGame\*.lua .
-
-# Create assets folder
-mkdir assets
-
-# Copy all asset files (images, sounds, etc.)
-copy ..\MyGame\*.png assets\
-copy ..\MyGame\*.wav assets\
-copy ..\MyGame\*.ogg assets\
-# Or copy entire folders
-xcopy /E /I ..\MyGame\images assets\images
-xcopy /E /I ..\MyGame\sounds assets\sounds
-
-# Configure with embedding enabled
-cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON
-
-# Build in release mode
-cmake --build . --config Release
-
-# Test with console to verify everything loaded
-YourGameName.exe --log
-
-# Test production mode (no console)
-YourGameName.exe
-
-Check console output for:
-# Create distribution folder
-mkdir ..\Distribution
-copy YourGameName.exe ..\Distribution\
-
-# Optional: Add README, LICENSE, etc.
-copy ..\README.txt ..\Distribution\
-
-Your game is now ready to distribute as a single executable!
-| Stage | Build Command | Files Needed | Result | |-------|--------------|--------------|--------| | Development | cmake .. && cmake --build . | Lua + assets external | Fast iteration | | Testing | cmake .. -DEMBED_MAIN=ON && cmake --build . | Lua in build/ | Test embedding | | Release | cmake .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON && cmake --build . --config Release | Lua + assets in build/ | Single .exe |
Problem: "No .lua files found in build directory"
-# Solution: Copy Lua files to build directory
-copy ..\*.lua .
-
-Problem: "No files found in assets folder"
-# Solution: Create assets folder and copy files
-mkdir assets
-copy ..\*.png assets\
-
-Problem: Game crashes on startup
-# Solution: Run with --log to see error messages
-YourGameName.exe --log
-
-Problem: Assets not loading
-build/assets/ before building--log to see loading errors.lua files in the build directory root are embedded when using EMBED_MAIN=ONEMBED_ASSETS=ONmain.lua must exist and is always the entry pointassets/images/player.png → Load with LoadImage("player.png")Want to add your own icon and version info to the executable? See CUSTOMIZATION.md for details on:
-ReiLua includes a built-in asset loading system with a loading screen UI that shows progress while assets are being loaded.
-Initialize asset loading progress tracking and show the loading screen.
-Parameters:
-totalAssets (integer) - Total number of assets to loadExample:
-RL.BeginAssetLoading(10) -- We're loading 10 assets
-
----
-Update the loading progress and display current asset being loaded.
-Parameters:
-assetName (string) - Name of the asset currently being loadedExample:
-RL.UpdateAssetLoading("player.png")
-
-Call this after each asset is loaded to update the progress bar.
----
-Finish asset loading and hide the loading screen.
-Example:
-RL.EndAssetLoading()
-
-function RL.init()
- -- List of assets to load
- local assetsToLoad = {
- "assets/player.png",
- "assets/enemy.png",
- "assets/background.png",
- "assets/music.wav",
- }
-
- -- Begin loading
- RL.BeginAssetLoading(#assetsToLoad)
-
- -- Load each asset
- for i, path in ipairs(assetsToLoad) do
- RL.UpdateAssetLoading(path) -- Update progress
-
- -- Load the actual asset
- if path:match("%.png$") or path:match("%.jpg$") then
- textures[i] = RL.LoadTexture(path)
- elseif path:match("%.wav$") or path:match("%.ogg$") then
- sounds[i] = RL.LoadSound(path)
- end
- end
-
- -- Done!
- RL.EndAssetLoading()
-end
-
-local assets = {}
-
-local assetsToLoad = {
- {type="texture", name="player", path="assets/player.png"},
- {type="texture", name="enemy", path="assets/enemy.png"},
- {type="texture", name="background", path="assets/background.png"},
- {type="sound", name="music", path="assets/music.wav"},
- {type="sound", name="shoot", path="assets/shoot.wav"},
- {type="font", name="title", path="assets/title.ttf"},
-}
-
-function RL.init()
- RL.SetWindowTitle("My Game")
-
- -- Start loading with progress
- RL.BeginAssetLoading(#assetsToLoad)
-
- -- Load all assets
- for i, asset in ipairs(assetsToLoad) do
- -- Show current asset name on loading screen
- RL.UpdateAssetLoading(asset.name)
-
- -- Load based on type
- if asset.type == "texture" then
- assets[asset.name] = RL.LoadTexture(asset.path)
- elseif asset.type == "sound" then
- assets[asset.name] = RL.LoadSound(asset.path)
- elseif asset.type == "font" then
- assets[asset.name] = RL.LoadFont(asset.path)
- end
- end
-
- -- Loading complete!
- RL.EndAssetLoading()
-
- print("Game ready!")
-end
-
-function RL.update(delta)
- -- Your game logic
-end
-
-function RL.draw()
- RL.ClearBackground(RL.RAYWHITE)
-
- -- Use loaded assets
- if assets.background then
- RL.DrawTexture(assets.background, {0, 0}, RL.WHITE)
- end
-
- if assets.player then
- RL.DrawTexture(assets.player, {100, 100}, RL.WHITE)
- end
-end
-
-The loading screen features a clean 1-bit pixel art style:
-Design:
-Elements:
-Background:
-Color Palette:
-Style Inspiration:
-If you want to customize the loading screen appearance, you can modify the colors and sizes in src/lua_core.c in the drawLoadingScreen() function.
1. Call UpdateAssetLoading AFTER loading - This ensures the progress updates at the right time 2. Load assets in order of importance - Load critical assets first 3. Group similar assets - Load all textures, then sounds, etc. 4. Use descriptive names - Shows better feedback to users
-local files = {"player.png", "enemy.png", "music.wav"}
-RL.BeginAssetLoading(#files)
-for i, file in ipairs(files) do
- RL.UpdateAssetLoading(file)
- -- load file
-end
-RL.EndAssetLoading()
-
-local assets = {
- textures = {"player.png", "enemy.png"},
- sounds = {"music.wav", "shoot.wav"},
-}
-local total = #assets.textures + #assets.sounds
-
-RL.BeginAssetLoading(total)
-for _, file in ipairs(assets.textures) do
- RL.UpdateAssetLoading(file)
- -- load texture
-end
-for _, file in ipairs(assets.sounds) do
- RL.UpdateAssetLoading(file)
- -- load sound
-end
-RL.EndAssetLoading()
-
-RL.BeginAssetLoading(#files)
-for i, file in ipairs(files) do
- RL.UpdateAssetLoading(file)
-
- if RL.FileExists(file) then
- -- load file
- else
- print("Warning: " .. file .. " not found")
- end
-end
-RL.EndAssetLoading()
-
-Use the loading system when:
-You can skip it when:
-The loading system makes your game feel polished with just a few lines of code!
-ReiLua includes a built-in splash screen system that displays splash screens before your game loads. This gives your game a polished appearance right from startup.
-When you run your ReiLua game, it automatically shows two splash screens in sequence:
-1. Custom Text - Clean, bold text on Raylib red background (similar to Squid Game style) 2. "Made using" - Text with Raylib and ReiLua logos displayed side-by-side
-Each splash screen:
-The logo images are always embedded into the executable in both development and release builds. This means:
-The splash screens display before your game's asset loading begins. This means:
-1. User starts your game 2. Splash screens play (~8 seconds) 3. Your RL.init() function runs 4. Asset loading with progress indicator (if you use it) 5. Your game starts
This creates a smooth, polished startup experience.
-During development, you often need to test your game repeatedly. Waiting for splash screens every time can slow down your workflow. Use the --no-logo flag to skip them:
# Windows
-ReiLua.exe --no-logo
-
-# Linux/Mac
-./ReiLua --no-logo
-
-# With other options
-ReiLua.exe --log --no-logo
-./ReiLua --no-logo path/to/game/
-
-Note: The --no-logo flag only works in development. In release builds, users should see the full splash screen sequence.
-The splash screen system is implemented in C and runs before any Lua code executes:
-1. Logo Embedding: During build, scripts/embed_logo.py converts PNG files to C byte arrays 2. Initialization: Before calling RL.init(), the engine initializes splash screens 3. Display Loop: A dedicated loop handles timing, fading, and rendering 4. Cleanup: After completion, resources are freed and Lua code begins
src/splash.c - Splash screen implementationinclude/splash.h - Header filescripts/embed_logo.py - Python script to embed logo imageslogo/raylib_logo.png - Raylib logo (embedded)logo/reilua_logo.png - ReiLua logo (embedded)The CMakeLists.txt automatically:
-1. Runs scripts/embed_logo.py during build 2. Generates embedded_logo.h with logo data 3. Defines EMBED_LOGO flag 4. Compiles splash.c with the project
No manual steps required - it just works!
-To change the default text to your studio name:
-1. Open src/splash.c 2. Find the splash drawing function 3. Change the text line:
const char* text = "YOUR STUDIO NAME";
-
-4. Rebuild the project
-Note: Use ALL CAPS for the Squid Game-style aesthetic. -To use different logos:
-1. Replace logo/raylib_logo.png and/or logo/reilua_logo.png with your images 2. Recommended size: 256x256 or smaller (logos are auto-scaled to max 200px) 3. Format: PNG with transparency support 4. Rebuild the project - logos will be automatically embedded
To adjust how long each screen displays:
-1. Open src/splash.c 2. Modify these constants at the top:
#define FADE_IN_TIME 0.8f // Seconds to fade in
- #define DISPLAY_TIME 2.5f // Seconds to display fully
- #define FADE_OUT_TIME 0.8f // Seconds to fade out
-
-3. Rebuild the project
-If you don't want any splash screens:
-1. Open src/main.c 2. Find this block:
/* Show splash screens if not skipped */
- if ( !skip_splash ) {
- splashInit();
- // ... splash code ...
- splashCleanup();
- }
-
-3. Comment out or remove the entire block 4. Rebuild the project
-Here's what a typical game startup looks like with everything enabled:
-ReiLua.exe MyGame/
-
-User Experience: 1. Splash Screen 1 (4.1 seconds)
-2. Splash Screen 2 (4.1 seconds)
-3. Asset Loading (varies)
-4. Game Start
-1. Keep --no-logo for Development: Always use --no-logo during active development 2. Test Without Flag: Occasionally test without --no-logo to ensure splash screens work 3. Customize for Your Studio: Change the text and logos to match your branding 4. Consider Total Time: Splash (~8s) + Loading (varies) = Total startup time 5. Optimize Loading: Keep asset loading fast to maintain a good first impression
--no-logo flaglogo/ folder before buildingcmake .. && make clean && makescripts/embed_logo.py has correct pathslogo/ folder exists with both PNG files# Development (skip splash)
-ReiLua --no-logo
-
-# Development with logging
-ReiLua --log --no-logo
-
-# Production/testing (full splash)
-ReiLua
-
-# Help
-ReiLua --help
-
----
-The splash screen system adds a polished touch to your ReiLua games with minimal effort. Customize it to match your studio's branding and give players a great first impression!
-ReiLua includes automated build scripts for easy development and release builds.
-scripts\build_dev.batscripts/build_dev.shscripts\build_release.batscripts/build_release.shFast iteration during game development with external Lua files and assets.
-Windows:
-scripts\build_dev.bat
-
-Linux/Unix:
-chmod +x scripts/build_dev.sh
-scripts/build_dev.sh
-
-scripts\build_dev.bat clean or scripts/build_dev.sh cleanbuild/ReiLua.execd your_game && path/to/build/ReiLua.exepath/to/build/ReiLua.exe --logCreate a single-file executable for distribution with all code and assets embedded.
-Before running the release build, prepare your files:
-cd build
-
-# Copy all Lua files
-copy ..\your_game\*.lua .
-# Or: cp ../your_game/*.lua .
-
-# Copy assets
-mkdir assets
-copy ..\your_game\assets\* assets\
-# Or: cp -r ../your_game/assets/* assets/
-
-Windows:
-scripts\build_release.bat
-
-Linux/Unix:
-chmod +x scripts/build_release.sh
-scripts/build_release.sh
-
-build/ directorybuild/assets/ folderbuild/ReiLua.exeThe release build automatically configures:
-EMBED_MAIN=ON - Embeds all Lua filesEMBED_ASSETS=ON - Embeds all assets (if assets folder exists)CMAKE_BUILD_TYPE=Release - Optimized build1. Replace icon.ico with your own icon file 2. Keep the same filename or update resources.rc 3. Rebuild
Edit resources.rc to customize:
VALUE "CompanyName", "Your Studio Name"
-VALUE "FileDescription", "Your Game Description"
-VALUE "ProductName", "Your Game Name"
-VALUE "LegalCopyright", "Copyright (C) Your Name, 2025"
-
-Edit CMakeLists.txt:
project( YourGameName ) # Line 6
-
-After building, the executable will be named YourGameName.exe.
# Initial setup
-scripts\build_dev.bat
-
-# Edit your Lua files in your game directory
-# ... make changes ...
-
-# Just run - no rebuild needed!
-cd your_game
-path\to\build\ReiLua.exe
-
-# If you modify C code, rebuild
-scripts\build_dev.bat
-
-# 1. Prepare files
-cd build
-copy ..\your_game\*.lua .
-mkdir assets
-copy ..\your_game\assets\* assets\
-
-# 2. Build release
-cd ..
-scripts\build_release.bat
-
-# 3. Test
-cd build
-ReiLua.exe --log
-
-# 4. Distribute
-# Copy build\ReiLua.exe to your distribution folder
-
-CMakeLists.txt exists in parent directorybuild/ directory before release buildmain.lua exists (required entry point)scripts\build_dev.bat cleanchmod +x build_*.shThis guide explains how to customize the ReiLua executable with your own branding.
-You can customize:
-The easiest customization - change "ReiLua.exe" to "YourGame.exe".
-1. Open CMakeLists.txt 2. Find line 6 (near the top):
project( ReiLua )
-
-3. Change to your game name:
- project( MyAwesomeGame )
-
-4. Rebuild:
- cd build
- cmake ..
- cmake --build . --config Release
-
-Result: Executable is now named MyAwesomeGame.exe
Replace the default icon with your game's icon.
-1. Create or convert your image to .ico format 2. Replace icon.ico in the ReiLua root folder with your icon 3. Keep the same filename (icon.ico) or update resources.rc:
IDI_ICON1 ICON "your_icon.ico"
-
-4. Rebuild the project
-Tip: Many online tools can convert PNG to ICO: -When users right-click your .exe and select "Properties", they see file information. Customize this to show your game details.
-1. Open resources.rc 2. Find the VERSIONINFO section 3. Modify these values:
1 VERSIONINFO
-FILEVERSION 1,0,0,0 // Change version numbers
-PRODUCTVERSION 1,0,0,0 // Change product version
-FILEFLAGSMASK 0x3fL
-FILEFLAGS 0x0L
-FILEOS VOS_NT_WINDOWS32
-FILETYPE VFT_APP
-FILESUBTYPE VFT2_UNKNOWN
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "Your Studio Name" // Your company/studio
- VALUE "FileDescription", "Your Game - An awesome game" // Game description
- VALUE "FileVersion", "1.0.0.0" // File version string
- VALUE "InternalName", "YourGame" // Internal name
- VALUE "LegalCopyright", "Copyright (C) 2025 Your Name" // Copyright notice
- VALUE "OriginalFilename", "YourGame.exe" // Original filename
- VALUE "ProductName", "Your Game" // Product name
- VALUE "ProductVersion", "1.0.0.0" // Product version string
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-1,0,0,0 for version 1.0.0.02,3,1,5 for version 2.3.1.54. Rebuild the project
-Change the text and logos that appear when your game starts.
-1. Open src/splash.c 2. Find the splash drawing function (around line 150) 3. Change this line:
const char* text = "YOUR STUDIO NAME";
-
-Style Tips:
-1. Create or find your logos:
-2. Replace these files:
- logo/raylib_logo.png → Your game logo
- logo/reilua_logo.png → Your studio logo (or keep ReiLua logo as credit)
-
-3. Logo sizing:
-4. Rebuild the project - logos are automatically embedded
-1. Open src/splash.c 2. Modify these constants at the top:
#define FADE_IN_TIME 0.8f // Seconds to fade in (default: 0.8)
- #define DISPLAY_TIME 2.5f // Seconds fully visible (default: 2.5)
- #define FADE_OUT_TIME 0.8f // Seconds to fade out (default: 0.8)
-
-Recommendations:
-1. Open src/splash.c 2. Find color definitions:
// First splash screen background (Raylib red)
- Color bgColor = (Color){ 230, 41, 55, 255 }; // Change these RGB values
-
- // Second splash screen background (Black)
- Color bg = BLACK; // Change to any color
-
-Color Examples:
-(Color){ 255, 255, 255, 255 }(Color){ 0, 120, 215, 255 }(Color){ 32, 32, 32, 255 }(Color){ R, G, B, 255 }Change the appearance of the asset loading screen.
-1. Open src/lua_core.c 2. Find the drawLoadingScreen() function 3. Modify colors and style:
// Background color
-Color bgColor = BLACK; // Change background
-
-// Text color
-Color textColor = WHITE; // Change text color
-
-// Progress bar fill color
-Color fillColor = WHITE; // Change bar fill
-
-// Border color
-Color borderColor = WHITE; // Change borders
-
-// In drawLoadingScreen() function
-const char* loadingText = "LOADING"; // Change to "LOADING GAME", etc.
-
-int barWidth = 200; // Default 200px, change as needed
-int barHeight = 16; // Default 16px, change as needed
-int borderThick = 2; // Border thickness
-
-Here's a complete example of rebranding ReiLua as "Space Quest":
-project( SpaceQuest )
-
-VALUE "CompanyName", "Cosmic Games Studio"
-VALUE "FileDescription", "Space Quest - Explore the Galaxy"
-VALUE "FileVersion", "1.0.0.0"
-VALUE "InternalName", "SpaceQuest"
-VALUE "LegalCopyright", "Copyright (C) 2025 Cosmic Games"
-VALUE "OriginalFilename", "SpaceQuest.exe"
-VALUE "ProductName", "Space Quest"
-VALUE "ProductVersion", "1.0.0.0"
-
-Replace with your space-themed icon
-const char* text = "COSMIC GAMES STUDIO";
-
-logo/raylib_logo.png → Your game logo (space ship, planet, etc.)
-logo/reilua_logo.png → Studio logo (keep ReiLua logo for credit)
-
-cd build
-cmake ..
-cmake --build . --config Release
-
-Result: SpaceQuest.exe with all your custom branding!
If you want to completely remove ReiLua references:
-1. Open src/splash.c 2. Find drawMadeWithSplash() function 3. Comment out or modify the function to only show your logo
1. Open src/main.c 2. Find the splash screen loop 3. Modify to only call your custom splash
After making any customizations:
-# Clean build (recommended after customizations)
-cd build
-rm -rf * # Or: rmdir /s /q * on Windows
-cmake ..
-cmake --build . --config Release
-
-# Test with console
-YourGame.exe --log
-
-# Test production mode
-YourGame.exe
-
-Verify:
-Before releasing your game:
-1. Consistent Branding: Use the same colors, fonts, and style across splash screens, loading screen, and in-game UI
-2. Icon Quality: Invest time in a good icon - it's the first thing users see
-3. Version Management: Update version numbers for each release
-4. Legal Info: Always include proper copyright and attribution
-5. Test Everything: Test your branded executable on a clean system
-6. Keep Credits: Mention Raylib and ReiLua in your game's credits screen
-Icon doesn't change:
-IconCache.dbProperties don't update:
-resources.rc syntax is correctSplash screens don't show changes:
-scripts/embed_logo.py ran successfullylogo/ folderExecutable name unchanged:
-CMakeLists.txt project name---
-Now your ReiLua executable is fully branded and ready to represent your game!
-This guide explains how to set up autocomplete, type hints, and documentation for ReiLua in Zed Editor.
----
-Zed uses the Lua Language Server (LuaLS) for Lua support. ReiLua includes tools/ReiLua_API.lua with LuaLS annotations.
Zed should automatically install LuaLS when you open a Lua file. If not:
-1. Open Zed 2. Go to Extensions (Cmd/Ctrl + Shift + X) 3. Search for "Lua" 4. Install the Lua extension
-Create a .luarc.json file in your project root:
{
- "runtime.version": "Lua 5.4",
- "workspace.library": [
- "${3rd}/luassert/library",
- "${3rd}/busted/library"
- ],
- "completion.enable": true,
- "diagnostics.globals": [
- "RL"
- ],
- "workspace.checkThirdParty": false
-}
-
-Copy tools/ReiLua_API.lua to your game project folder:
# From ReiLua directory
-cp tools/ReiLua_API.lua /path/to/your/game/project/
-
-Or on Windows:
-Copy-Item tools/ReiLua_API.lua "C:\path\to\your\game\project\"
-
-For better organization, create a library directory:
-your-game/
-├── main.lua
-├── .luarc.json
-└── .lua/
- └── tools/ReiLua_API.lua
-
-Update .luarc.json:
{
- "runtime.version": "Lua 5.4",
- "workspace.library": [".lua"],
- "completion.enable": true,
- "diagnostics.globals": ["RL"],
- "workspace.checkThirdParty": false
-}
-
----
-To make ReiLua API available for all projects:
-1. Create directory: %USERPROFILE%\.luarocks\lib\lua\5.4\ 2. Copy tools/ReiLua_API.lua to this directory 3. Add to global LuaLS config:
%APPDATA%\Zed\settings.json or via Zed settings
-{
- "lsp": {
- "lua-language-server": {
- "settings": {
- "Lua.workspace.library": [
- "C:\\Users\\YourName\\.luarocks\\lib\\lua\\5.4"
- ],
- "Lua.diagnostics.globals": ["RL"]
- }
- }
- }
-}
-
-1. Create directory: ~/.lua/reilua/ 2. Copy tools/ReiLua_API.lua to this directory 3. Update Zed settings:
{
- "lsp": {
- "lua-language-server": {
- "settings": {
- "Lua.workspace.library": [
- "~/.lua/reilua"
- ],
- "Lua.diagnostics.globals": ["RL"]
- }
- }
- }
-}
-
----
-Create a .zed/settings.json in your project: > Note There is a sample zed settings json file in the repo root (zed.sample.settings.json)
{
- "lsp": {
- "lua-language-server": {
- "settings": {
- "Lua.runtime.version": "Lua 5.4",
- "Lua.workspace.library": [
- "."
- ],
- "Lua.completion.enable": true,
- "Lua.completion.callSnippet": "Replace",
- "Lua.completion.displayContext": 3,
- "Lua.diagnostics.globals": [
- "RL"
- ],
- "Lua.hint.enable": true,
- "Lua.hint.paramName": "All",
- "Lua.hint.setType": true
- }
- }
- }
-}
-
----
-Create a test file test.lua:
function RL.init()
- -- Type "RL." and you should see autocomplete
- RL.SetWindowTitle("Test") -- Should show documentation
-
- local color = RL.RED -- Should autocomplete color constants
-
- -- Hover over functions to see documentation
- RL.DrawText("Hello", 10, 10, 20, color)
-end
-
-function RL.update(delta)
- -- 'delta' should show as number type
-end
-
-If autocomplete works, you should see:
-RL.---
-In Zed settings:
-{
- "inlay_hints": {
- "enabled": true
- },
- "lsp": {
- "lua-language-server": {
- "settings": {
- "Lua.hint.enable": true,
- "Lua.hint.paramName": "All",
- "Lua.hint.setType": true,
- "Lua.hint.paramType": true
- }
- }
- }
-}
-
-This will show:
-Add these to suppress common false positives:
-{
- "lsp": {
- "lua-language-server": {
- "settings": {
- "Lua.diagnostics.disable": [
- "lowercase-global",
- "unused-local",
- "duplicate-set-field",
- "missing-fields",
- "undefined-field"
- ],
- "Lua.diagnostics.globals": ["RL"]
- }
- }
- }
-}
-
-Common warnings and what they mean:
-lowercase-global - Using global variables with lowercase names (RL is intentional)unused-local - Local variables that aren't usedduplicate-set-field - Redefining functions (callback functions are expected to be redefined)missing-fields - Table fields that might not existundefined-field - Accessing fields that aren't documented> Note: The tools/ReiLua_API.lua file now uses type annotations instead of function definitions for callbacks to prevent duplicate warnings.
---
-Duplicate field 'init'. (Lua Diagnostics. duplicate-set-field)
-Why: The tools/ReiLua_API.lua file previously defined callback functions as empty function definitions. When you define them in your main.lua, LSP sees it as redefining the same field.
-Solution: The latest tools/ReiLua_API.lua now uses type annotations instead:
--- Old way (caused warnings)
-function RL.init() end
-
--- New way (no warnings)
----@type fun()
-RL.init = nil
-
-Fix Steps: 1. Update tools/ReiLua_API.lua - Copy the latest version from the repository 2. Or add to diagnostics.disable in your configuration:
{
- "diagnostics.disable": ["duplicate-set-field"]
- }
-
-3. Restart Zed to reload the configuration
-Benefits of the new approach:
----
-1. Restart Zed after configuration changes 2. Check LSP Status: Look for Lua Language Server in bottom-right status bar 3. Verify File Location: Ensure tools/ReiLua_API.lua is in the workspace 4. Check Console: Open Zed's log to see LSP errors
If the language server is slow:
-{
- "lsp": {
- "lua-language-server": {
- "settings": {
- "Lua.workspace.maxPreload": 2000,
- "Lua.workspace.preloadFileSize": 1000
- }
- }
- }
-}
-
-Ensure hover is enabled:
-{
- "hover_popover_enabled": true
-}
-
----
-You can extend tools/ReiLua_API.lua with your own game types:
---@class Player
----@field x number
----@field y number
----@field health number
-
----@class Enemy
----@field x number
----@field y number
----@field damage number
-
--- Your game globals
----@type Player
-player = {}
-
----@type Enemy[]
-enemies = {}
-
----
-Ctrl+Space (Windows/Linux) or Cmd+Space (macOS)Ctrl+K Ctrl+IF12 or Cmd+ClickShift+F12F2---
----
-my-reilua-game/
-├── .luarc.json # LuaLS configuration
-├── .zed/
-│ └── settings.json # Zed-specific settings
-├── tools/ReiLua_API.lua # API definitions (copy from ReiLua)
-├── main.lua # Your game entry point
-├── player.lua
-├── enemy.lua
-└── assets/
- ├── sprites/
- └── sounds/
-
----
-Save this as .luarc.json in your project:
{
- "runtime.version": "Lua 5.4",
- "completion.enable": true,
- "completion.callSnippet": "Replace",
- "diagnostics.globals": ["RL"],
- "diagnostics.disable": [
- "lowercase-global",
- "duplicate-set-field",
- "missing-fields"
- ],
- "workspace.checkThirdParty": false,
- "workspace.library": ["."],
- "hint.enable": true
-}
-
-Save this as .zed/settings.json:
{
- "lsp": {
- "lua-language-server": {
- "settings": {
- "Lua.hint.enable": true,
- "Lua.hint.paramName": "All",
- "Lua.hint.setType": true,
- "Lua.diagnostics.disable": [
- "lowercase-global",
- "duplicate-set-field",
- "missing-fields"
- ]
- }
- }
- },
- "inlay_hints": {
- "enabled": true
- }
-}
-
-Then copy tools/ReiLua_API.lua to your project root, and you're ready to go!
---
-Happy Coding!
-