diff options
| author | Indrajith K L | 2025-11-03 19:09:36 +0530 |
|---|---|---|
| committer | Indrajith K L | 2025-11-03 19:17:06 +0530 |
| commit | cc305c3cdb0cdb7098c70ffcb82fa49bc16e0d21 (patch) | |
| tree | e7bad9b23ff70dfead36b4b7c9820b83fa70d1b0 | |
| parent | 9c62d9dc1bbc4d344e679946e9cb75cbca806cf2 (diff) | |
| download | reilua-enhanced-cc305c3cdb0cdb7098c70ffcb82fa49bc16e0d21.tar.gz reilua-enhanced-cc305c3cdb0cdb7098c70ffcb82fa49bc16e0d21.tar.bz2 reilua-enhanced-cc305c3cdb0cdb7098c70ffcb82fa49bc16e0d21.zip | |
docs: clean up personal references for public use
| -rw-r--r-- | ASSET_LOADING.md | 8 | ||||
| -rw-r--r-- | CUSTOMIZATION.md | 401 | ||||
| -rw-r--r-- | DOCUMENTATION_INDEX.md | 213 | ||||
| -rw-r--r-- | EMBEDDING.md | 1 | ||||
| -rw-r--r-- | README.md | 849 | ||||
| -rw-r--r-- | SPLASH_SCREENS.md | 20 | ||||
| -rw-r--r-- | UPGRADE_SUMMARY.md | 4 | ||||
| -rw-r--r-- | ZED_EDITOR_SETUP.md | 579 |
8 files changed, 1952 insertions, 123 deletions
diff --git a/ASSET_LOADING.md b/ASSET_LOADING.md index 67a3702..a38a264 100644 --- a/ASSET_LOADING.md +++ b/ASSET_LOADING.md @@ -10,7 +10,7 @@ ReiLua includes a built-in asset loading system with a nice loading screen UI th - Smooth progress bar with shimmer effect - Progress percentage (e.g., "3 / 10") - Current asset name being loaded - - Dark, professional color scheme + - Dark, clean color scheme - **Easy to Use** - Just 3 functions to show loading progress - **Works Everywhere** - Development and release builds @@ -266,7 +266,7 @@ RL.EndAssetLoading() - You have more than 5-10 assets to load - Assets are large (images, sounds, fonts) - Loading might take more than 1 second -- You want professional loading feedback +- You want polished loading feedback **You can skip it when:** - You have very few, small assets @@ -275,11 +275,11 @@ RL.EndAssetLoading() ## ✨ Benefits -- ✅ Professional user experience +- ✅ Polished user experience - ✅ User knows the game is loading, not frozen - ✅ Shows progress for large asset sets - ✅ Works with embedded assets - ✅ Minimal code required - ✅ Beautiful default UI -The loading system makes your game feel polished and professional with just a few lines of code! +The loading system makes your game feel polished with just a few lines of code! diff --git a/CUSTOMIZATION.md b/CUSTOMIZATION.md new file mode 100644 index 0000000..ab74a33 --- /dev/null +++ b/CUSTOMIZATION.md @@ -0,0 +1,401 @@ +# Customizing Your ReiLua Executable + +This guide explains how to customize the ReiLua executable with your own branding. + +## Overview + +You can customize: +- Executable name +- Window icon +- File properties (company name, version, description, etc.) +- Splash screen text and logos +- Loading screen appearance + +## Quick Customization Checklist + +- [ ] Change executable name in CMakeLists.txt +- [ ] Replace icon.ico with your game icon +- [ ] Edit resources.rc with your game information +- [ ] Customize splash screens in src/splash.c +- [ ] Replace logo images in logo/ folder +- [ ] Rebuild the project + +## 1. Changing the Executable Name + +The easiest customization - change "ReiLua.exe" to "YourGame.exe". + +### Steps + +1. Open `CMakeLists.txt` +2. Find line 6 (near the top): + ```cmake + project( ReiLua ) + ``` +3. Change to your game name: + ```cmake + project( MyAwesomeGame ) + ``` +4. Rebuild: + ```bash + cd build + cmake .. + cmake --build . --config Release + ``` + +Result: Executable is now named `MyAwesomeGame.exe` + +## 2. Adding a Custom Icon + +Replace the default icon with your game's icon. + +### Requirements + +- **Format**: .ico file (Windows icon format) +- **Recommended sizes**: 16x16, 32x32, 48x48, 256x256 +- **Tools**: Use online converters or tools like IcoFX, GIMP, or Photoshop + +### Steps + +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`: + ```rc + IDI_ICON1 ICON "your_icon.ico" + ``` +4. Rebuild the project + +**Tip**: Many online tools can convert PNG to ICO: +- https://convertio.co/png-ico/ +- https://www.icoconverter.com/ + +## 3. Customizing Executable Properties + +When users right-click your .exe and select "Properties", they see file information. Customize this to show your game details. + +### Steps + +1. Open `resources.rc` +2. Find the `VERSIONINFO` section +3. Modify these values: + +```rc +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 +``` + +### Common Values + +**FileVersion / ProductVersion Format**: Major, Minor, Patch, Build +- Example: `1,0,0,0` for version 1.0.0.0 +- Example: `2,3,1,5` for version 2.3.1.5 + +**CompanyName Examples**: +- "Your Studio Name" +- "Independent Developer" +- "Your Name Games" + +**FileDescription**: +- Short description users see in file properties +- Example: "Space Adventure Game" +- Example: "Puzzle Game with Physics" + +**LegalCopyright**: +- Standard format: "Copyright (C) Year Your Name" +- Example: "Copyright (C) 2025 Indie Studios" + +4. Rebuild the project + +## 4. Customizing Splash Screens + +Change the text and logos that appear when your game starts. + +### Changing Splash Screen Text + +1. Open `src/splash.c` +2. Find the splash drawing function (around line 150) +3. Change this line: + ```c + const char* text = "YOUR STUDIO NAME"; + ``` + +**Style Tips**: +- Use ALL CAPS for bold impact +- Keep it short (under 30 characters) +- Examples: "INDIE STUDIO GAMES", "MADE BY YOUR NAME", "GAME JAM 2025" + +### Changing Splash Screen Logos + +1. Create or find your logos: + - **Recommended size**: 256x256 pixels or smaller + - **Format**: PNG with transparency + - **Style**: Simple, recognizable logos work best + +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: + - Logos are automatically scaled to max 200px + - They display side-by-side on second splash screen + - Maintain aspect ratio + +4. Rebuild the project - logos are automatically embedded + +### Changing Splash Screen Timing + +1. Open `src/splash.c` +2. Modify these constants at the top: + ```c + #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**: +- Keep fade times between 0.5 - 1.5 seconds +- Display time between 1.5 - 3.5 seconds +- Total splash time ideally under 10 seconds + +### Changing Splash Screen Colors + +1. Open `src/splash.c` +2. Find color definitions: + ```c + // 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**: +- White: `(Color){ 255, 255, 255, 255 }` +- Blue: `(Color){ 0, 120, 215, 255 }` +- Dark Gray: `(Color){ 32, 32, 32, 255 }` +- Your brand color: `(Color){ R, G, B, 255 }` + +## 5. Customizing the Loading Screen + +Change the appearance of the asset loading screen. + +### Steps + +1. Open `src/lua_core.c` +2. Find the `drawLoadingScreen()` function +3. Modify colors and style: + +```c +// 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 +``` + +### Customizing Loading Text + +```c +// In drawLoadingScreen() function +const char* loadingText = "LOADING"; // Change to "LOADING GAME", etc. +``` + +### Changing Progress Bar Size + +```c +int barWidth = 200; // Default 200px, change as needed +int barHeight = 16; // Default 16px, change as needed +int borderThick = 2; // Border thickness +``` + +## 6. Complete Rebranding Example + +Here's a complete example of rebranding ReiLua as "Space Quest": + +### 1. CMakeLists.txt +```cmake +project( SpaceQuest ) +``` + +### 2. resources.rc +```rc +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" +``` + +### 3. icon.ico +Replace with your space-themed icon + +### 4. src/splash.c +```c +const char* text = "COSMIC GAMES STUDIO"; +``` + +### 5. logo/ folder +``` +logo/raylib_logo.png → Your game logo (space ship, planet, etc.) +logo/reilua_logo.png → Studio logo (keep ReiLua logo for credit) +``` + +### 6. Build +```bash +cd build +cmake .. +cmake --build . --config Release +``` + +Result: `SpaceQuest.exe` with all your custom branding! + +## 7. Advanced: Removing ReiLua Branding + +If you want to completely remove ReiLua references: + +### Remove "Made with ReiLua" Logo + +1. Open `src/splash.c` +2. Find `drawMadeWithSplash()` function +3. Comment out or modify the function to only show your logo + +### Remove Second Splash Screen + +1. Open `src/main.c` +2. Find the splash screen loop +3. Modify to only call your custom splash + +**Note**: Please keep attribution to Raylib and ReiLua in your game's credits or about screen as a courtesy! + +## 8. Build and Test + +After making any customizations: + +```bash +# 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: +- ✅ Executable has correct name +- ✅ Icon appears in file explorer +- ✅ Right-click → Properties shows correct info +- ✅ Splash screens display correctly +- ✅ Loading screen appears as expected + +## Checklist: Release-Ready Customization + +Before releasing your game: + +- [ ] Executable name matches your game +- [ ] Custom icon is recognizable at small sizes +- [ ] File properties are complete and accurate +- [ ] Splash screens show correct studio name +- [ ] Logos are high quality and appropriate size +- [ ] Loading screen matches your game's aesthetic +- [ ] Copyright and legal information is correct +- [ ] Version numbers are accurate +- [ ] Tested on target platforms +- [ ] Credits mention Raylib and ReiLua + +## Tips for Polish + +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 + +## Troubleshooting + +**Icon doesn't change:** +- Ensure .ico file is valid +- Rebuild completely (clean build) +- Clear icon cache (Windows): Delete `IconCache.db` + +**Properties don't update:** +- Verify `resources.rc` syntax is correct +- Rebuild completely +- Check that resource compiler ran (check build output) + +**Splash screens don't show changes:** +- Rebuild with clean build +- Check `embed_logo.py` ran successfully +- Verify logo files exist in `logo/` folder + +**Executable name unchanged:** +- Check `CMakeLists.txt` project name +- Do a clean rebuild +- Verify cmake configuration step succeeded + +## Additional Resources + +### Icon Creation Tools +- **IcoFX**: Icon editor (paid) +- **GIMP**: Free, supports ICO export +- **Online**: convertio.co, icoconverter.com + +### Image Editing +- **GIMP**: Free, powerful image editor +- **Paint.NET**: Simple, free Windows editor +- **Photoshop**: Industry standard (paid) + +### Color Picking +- **ColorPicker**: Use system color picker +- **HTML Color Codes**: htmlcolorcodes.com +- **Adobe Color**: color.adobe.com + +--- + +Now your ReiLua executable is fully branded and ready to represent your game! diff --git a/DOCUMENTATION_INDEX.md b/DOCUMENTATION_INDEX.md new file mode 100644 index 0000000..b927a29 --- /dev/null +++ b/DOCUMENTATION_INDEX.md @@ -0,0 +1,213 @@ +# Documentation Overview + +This document provides a quick reference to all available documentation for ReiLua Enhanced Edition. + +## Core Documentation + +### 📘 [README.md](README.md) - **START HERE** +The main documentation covering: +- What is ReiLua Enhanced Edition +- Complete attributions (Raylib, ReiLua, enhancements) +- Quick start guide +- All enhanced features overview +- Command line options +- Building from source (Windows, Linux, Mac, Raspberry Pi, Web) +- Complete release workflow +- Troubleshooting + +**Read this first!** + +--- + +## Feature-Specific Guides + +### 🎨 [SPLASH_SCREENS.md](SPLASH_SCREENS.md) +Everything about splash screens: +- How the dual splash screen system works +- Custom text splash screen details +- "Made using Raylib + ReiLua" screen details +- Skipping splashes with `--no-logo` flag +- Customizing text, logos, timing, and colors +- Technical implementation details +- Troubleshooting splash screen issues + +### 📦 [EMBEDDING.md](EMBEDDING.md) +Complete guide to embedding: +- Development vs release workflows +- Embedding Lua files (`EMBED_MAIN=ON`) +- Embedding assets (`EMBED_ASSETS=ON`) +- Console control with `--log` flag +- Complete release build workflow +- Asset path consistency +- Troubleshooting embedding issues + +### 📊 [ASSET_LOADING.md](ASSET_LOADING.md) +Asset loading system documentation: +- API functions (`BeginAssetLoading`, `UpdateAssetLoading`, `EndAssetLoading`) +- Beautiful 1-bit pixel art loading screen +- Complete examples +- Loading patterns +- Progress tracking +- When to use the loading system +- Customization options + +### 🔧 [BUILD_SCRIPTS.md](BUILD_SCRIPTS.md) +Build automation documentation: +- `build_dev.bat` / `build_dev.sh` - Development builds +- `build_release.bat` / `build_release.sh` - Release builds +- Features of each build type +- Workflow examples +- Customizing executable name, icon, and properties +- Troubleshooting build issues + +### 🎨 [CUSTOMIZATION.md](CUSTOMIZATION.md) +Complete rebranding guide: +- Changing executable name +- Adding custom icon +- Customizing file properties (company name, version, etc.) +- Customizing splash screens +- Customizing loading screen +- Complete rebranding example +- Removing ReiLua branding (with attribution notes) + +### 💻 [ZED_EDITOR_SETUP.md](ZED_EDITOR_SETUP.md) +Complete Zed editor setup: +- Why Zed for ReiLua development +- Installation guide +- Lua Language Server configuration +- Project setup with `.zed/settings.json` +- Task configuration for quick testing +- Essential keyboard shortcuts +- Multi-cursor editing, split views, Vim mode +- Troubleshooting LSP issues +- Workflow tips and best practices + +--- + +## Technical Documentation + +### 📚 [API.md](API.md) +Complete API reference: +- 1000+ functions +- All ReiLua/Raylib bindings +- Function signatures +- Raygui, Raymath, Lights, Easings, RLGL modules + +### 📝 [ReiLua_API.lua](ReiLua_API.lua) +Lua annotations file: +- Provides autocomplete in LSP-enabled editors +- Function documentation +- Copy to your project for IDE support + +### 🔄 [UPGRADE_SUMMARY.md](UPGRADE_SUMMARY.md) +Technical implementation details: +- Features added in this enhanced version +- Files modified and added +- Build options explained +- Testing checklist +- Known changes from original ReiLua + +--- + +## Quick Reference by Task + +### "I want to start making a game" +1. Read [README.md](README.md) - Quick Start section +2. Look at examples in `examples/` folder +3. Use `ReiLua.exe --log --no-logo` for development + +### "I want to embed my game into a single .exe" +1. Read [EMBEDDING.md](EMBEDDING.md) +2. Use `build_release.bat` / `build_release.sh` +3. Follow the complete release workflow in [README.md](README.md) + +### "I want to add a loading screen" +1. Read [ASSET_LOADING.md](ASSET_LOADING.md) +2. Use `RL.BeginAssetLoading()`, `RL.UpdateAssetLoading()`, `RL.EndAssetLoading()` +3. See complete examples in the guide + +### "I want to customize splash screens" +1. Read [SPLASH_SCREENS.md](SPLASH_SCREENS.md) +2. Edit `src/splash.c` for text changes +3. Replace logo files in `logo/` folder +4. Rebuild project + +### "I want to rebrand the executable" +1. Read [CUSTOMIZATION.md](CUSTOMIZATION.md) +2. Change project name in `CMakeLists.txt` +3. Replace `icon.ico` +4. Edit `resources.rc` +5. Customize splash screens +6. Rebuild + +### "I want to setup my code editor" +1. Read [ZED_EDITOR_SETUP.md](ZED_EDITOR_SETUP.md) +2. Install Zed and Lua Language Server +3. Copy `ReiLua_API.lua` to your project +4. Create `.zed/settings.json` configuration +5. Set up tasks for quick testing + +### "I want to build ReiLua from source" +1. Read [README.md](README.md) - Building from Source section +2. Install prerequisites (CMake, compiler, Raylib, Lua) +3. Use `build_dev.bat` for development +4. Use `build_release.bat` for release + +### "I need API reference" +1. Open [API.md](API.md) +2. Search for function name +3. See function signature and description +4. Or copy [ReiLua_API.lua](ReiLua_API.lua) for autocomplete + +--- + +## Documentation File Sizes + +| File | Size | Purpose | +|------|------|---------| +| README.md | 21 KB | Main documentation (START HERE) | +| ZED_EDITOR_SETUP.md | 13 KB | Editor setup guide | +| CUSTOMIZATION.md | 11 KB | Rebranding guide | +| ASSET_LOADING.md | 8 KB | Loading system guide | +| EMBEDDING.md | 7 KB | Embedding guide | +| SPLASH_SCREENS.md | 7 KB | Splash screen guide | +| UPGRADE_SUMMARY.md | 6 KB | Technical details | +| BUILD_SCRIPTS.md | 5 KB | Build automation guide | +| API.md | 207 KB | Complete API reference | + +--- + +## Contribution + +When adding new features, please: +1. Update relevant documentation +2. Add examples where appropriate +3. Update this overview if adding new docs +4. Test documentation accuracy + +--- + +## Documentation Standards + +All documentation follows these standards: +- ✅ Clear headings and structure +- ✅ Code examples for all features +- ✅ Troubleshooting sections +- ✅ Cross-references to related docs +- ✅ Platform-specific notes where needed +- ✅ Emoji icons for visual scanning +- ✅ Complete but concise + +--- + +## Quick Links + +- **Original ReiLua**: https://github.com/Gamerfiend/ReiLua +- **Raylib**: https://github.com/raysan5/raylib +- **Lua**: https://www.lua.org/ +- **Zed Editor**: https://zed.dev/ + +--- + +**Last Updated**: 2025-01-03 +**Documentation Version**: 1.0 (Enhanced Edition) diff --git a/EMBEDDING.md b/EMBEDDING.md index c496059..13f3752 100644 --- a/EMBEDDING.md +++ b/EMBEDDING.md @@ -69,7 +69,6 @@ Distribution/ - ✅ Single executable file - ✅ No external dependencies - ✅ Users can't modify game files -- ✅ Professional distribution - ✅ Smaller download (no separate files) ## Quick Start @@ -1,46 +1,119 @@  -## About +# ReiLua - Enhanced Edition -Please note that ReiLua is lovingly :heart: handcrafted and will likely contain bugs and documentation errors so it would be much appreciated if you would report any such findings. +> **A modified version of ReiLua with embedded main.lua, embedded assets, splash screens, and asset loading system** -Idea of this project was to bring the power and simplicity of Raylib to easy beginner friendly language like Lua in a very straight forward manner. It is loose binding to Raylib, some functions will not be included and some are added. The idea of pointing "main.lua" file and access functions "init", "update" and "draw" are borrowed from Löve game framework. +## About This Version -ReiLua is not planned to be a one-to-one binding to raylib. If you want more direct bindings, there are other projects like https://github.com/TSnake41/raylib-lua. +This is an enhanced version of ReiLua featuring: +- 🎮 **Embedded Lua Support** - Bundle all your Lua code into a single executable +- 📦 **Embedded Assets** - Package images, sounds, and other assets into your game +- 🎨 **Splash Screens** - Customizable startup screens featuring Raylib and ReiLua +- 📊 **Asset Loading System** - Beautiful loading screen with progress tracking +- 🔧 **Automated Build Scripts** - One-command development and release builds +- 🪟 **Console Control** - Debug logging system for development -Reilua means fair in finnish. +## What is ReiLua? -## Status +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 :heart: 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. + +## Attributions + +This enhanced version is built upon: + +### Core Framework +- **[Raylib](https://github.com/raysan5/raylib)** (v5.5) - A simple and easy-to-use library to enjoy videogames programming + - Created by Ramon Santamaria ([@raysan5](https://github.com/raysan5)) + - Licensed under the zlib/libpng license +- **[ReiLua](https://github.com/Gamerfiend/ReiLua)** - The original Lua bindings for Raylib + - Created by Gamerfiend + - Licensed under the zlib/libpng license +- **[Lua](https://www.lua.org/)** (v5.4) - Powerful, efficient, lightweight, embeddable scripting language + +### Enhancements Added +- Embedded Lua and asset support system +- Splash screen implementation +- Asset loading progress API with retro UI +- Build automation scripts +- Console control system +- Comprehensive documentation -ReiLua is WIP and some planned raylib functionality is still missing but it already has over 1000 functions. Current Raylib version 5.5. +### Additional Components +- **Raygui** - Immediate mode GUI library +- **Raymath** - Math utilities for game development +- **Lights** - 3D lighting system +- **Easings** - Easing functions for smooth animations +- **RLGL** - OpenGL abstraction layer -Included submodules. +### Font +- **Oleaguid** - Custom pixel art font for splash and loading screens +## Status + +ReiLua is WIP and some planned raylib functionality is still missing, but it already has over 1000 functions. Current Raylib version is 5.5. + +### Included Submodules * Raygui * Raymath * Lights * Easings * RLGL -List of some MISSING features that are planned to be included. For specific function, check API and apiScanner.lua. - +### Missing Features +List of some MISSING features that are planned to be included: * Core * VR stereo config functions for VR simulator ## Roadmap * v0.9 - + * Stability improvements + * Additional raylib bindings * v1.0 - * raylib 6.0 + * raylib 6.0 support + +## Quick Start + +### For Game Developers -## Usage +**Development Mode (Fast Iteration):** +```bash +# 1. Create your game files +GameFolder/ +├── main.lua +├── assets/ +│ ├── player.png +│ └── music.wav -Application needs 'main.lua' or 'main' file as entry point. ReiLua executable will first look it from same directory. Alternatively, path to the folder where "main.lua" is located can be given as argument. There are seven Lua functions that the framework will call, 'RL.init', 'RL.update', 'RL.draw', 'RL.event', 'RL.log', 'RL.exit' and 'RL.config'. +# 2. Run ReiLua pointing to your game folder +ReiLua.exe GameFolder/ -Example of basic "main.lua" file that will show basic windows with text. +# Or from your game folder +cd GameFolder +path/to/ReiLua.exe -```Lua +# Skip splash screens during development +ReiLua.exe --no-logo + +# Enable console for debugging +ReiLua.exe --log --no-logo +``` + +**Release Mode (Single Executable):** +```bash +# See "Building for Release" section below +``` + +### Basic Example + +Create a `main.lua` file: + +```lua local textColor = RL.BLACK local textPos = { 192, 200 } local textSize = 20 @@ -72,205 +145,769 @@ function RL.draw() end ``` -Application folder structure should be... - +Run it: +```bash +ReiLua.exe --no-logo ``` -GameFolder - \ReiLua.exe - \main.lua + +## Framework Functions + +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 initialization +- **`RL.update(delta)`** - Called every frame before draw, receives delta time +- **`RL.draw()`** - Called every frame for rendering +- **`RL.event(event)`** - Called when events occur +- **`RL.log(logLevel, message)`** - Called for logging +- **`RL.exit()`** - Called when the application is closing +- **`RL.config()`** - ⚠️ Deprecated in this version + +All functionality can be found in "API.md". + +## Enhanced Features + +### 1. Splash Screens + +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:** +```bash +ReiLua.exe --no-logo ``` -Application should now start successfully from executable. All functionality can be found in "API". +**Customize:** +- Change text in `src/splash.c` +- Replace logos in `logo/` folder +- Adjust timing with constants in `src/splash.c` -ReiLua_API.lua can be put into project folder to provide annotations when using "Lua Language Server". +See [SPLASH_SCREENS.md](SPLASH_SCREENS.md) for full documentation. -## Object unloading +### 2. Asset Loading System -Some objects allocate memory that needs to be freed when object is no longer needed. By default objects like Textures are unloaded by the Lua garbage collector. It is generatty however recommended to handle this manually in more complex projects. You can change the behavior with: +Beautiful loading screen with progress tracking: +```lua +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 ``` -RL.SetGCUnload() + +**Features:** +- Retro 1-bit pixel art aesthetic +- Animated loading text with dots +- Progress bar with dithering pattern +- Shows current asset name +- Progress counter (e.g., "3/10") +- Corner decorations + +See [ASSET_LOADING.md](ASSET_LOADING.md) for full documentation. + +### 3. Embedded Lua Files + +Bundle all your Lua code into the executable for easy distribution: + +```bash +# Copy Lua files to build directory +cd build +copy ..\your_game\*.lua . + +# Build with embedding +cmake .. -DEMBED_MAIN=ON +cmake --build . --config Release ``` -## Interpreter Mode +Result: Single executable with all Lua code embedded! + +### 4. Embedded Assets -ReiLua can also be used to run single lua file using interpreter mode with arguments -i or --interpret. Given file will be called with dofile. Usage example: +Package images, sounds, fonts, and other assets into your executable: + +```bash +# 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 ``` -./Reilua -i hello.lua + +**Your Lua code doesn't change!** Use the same paths: +```lua +-- Works in both development and release +playerImg = RL.LoadTexture("assets/player.png") +music = RL.LoadSound("assets/music.wav") ``` -## Generate API +See [EMBEDDING.md](EMBEDDING.md) for full documentation. -Generate API.md and ReiLua_API.lua from build folder with command. +### 5. Console Control (Windows) -``` -./Reilua -i ../docgen.lua +By default, ReiLua runs without a console window for a clean user experience. Enable it for debugging: + +```bash +# Show console for debugging +ReiLua.exe --log + +# Combine with other options +ReiLua.exe --log --no-logo +ReiLua.exe --log path/to/game ``` -## Building +This shows: +- TraceLog output +- Print statements +- Lua errors +- Debug information -I think the simplest way would be to statically link Raylib and Lua to the same executable. Specially on Linux this would simplify distribution of games since different distros tend to use different versions of librarys. Of course if you plan to only experiment with it, this isn't so important. +### 6. Automated Build Scripts -https://github.com/raysan5/raylib +One-command builds for development and release: -https://github.com/lua/lua or https://github.com/LuaJIT/LuaJIT +**Development Build (Fast Iteration):** +```bash +# Windows +build_dev.bat -Note! Lua header files are from Lua 5.4.0, if you use different version be sure to replace them. +# Linux/Unix +chmod +x build_dev.sh +./build_dev.sh +``` +- No embedding +- Fast build times +- Edit code without rebuilding -### Linux +**Release Build (Distribution):** +```bash +# Prepare files first +cd build +copy ..\your_game\*.lua . +mkdir assets +copy ..\your_game\assets\* assets\ -Compile Raylib and lua by following their instructions. They will compile to libraylib.a and liblua.a by default. +# Build release +cd .. -You need build essential and cmake. If you compiled Raylib you should already have these. +# Windows +build_release.bat +# Linux/Unix +./build_release.sh ``` -sudo apt install build-essential -sudo apt install cmake +- Embeds all Lua files +- Embeds all assets +- Creates single executable +- Release optimizations + +See [BUILD_SCRIPTS.md](BUILD_SCRIPTS.md) for full documentation. + +## 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) + --no-logo Skip splash screens (development) ``` -If compiling statically, move libraylib.a and liblua.a to "ReiLua/lib" folder. From "ReiLua" folder... +### Examples + +```bash +# 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 ``` -cd build -cmake .. -make + +## Object Unloading + +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: + +```lua +RL.SetGCUnload() ``` -Run example. +## Interpreter Mode + +ReiLua can run single Lua files using interpreter mode: +```bash +ReiLua -i hello.lua ``` -./ReiLua ../examples/snake/ + +The given file will be called with `dofile`. + +## Generate API Documentation + +Generate API.md and ReiLua_API.lua from the build folder: + +```bash +ReiLua -i ../docgen.lua ``` -If you now see extremely low res snake racing off the window then you are successfull. Congratulations! You can reset the game by pressing enter. +**Tip:** Use ReiLua_API.lua in your project folder to provide annotations when using "Lua Language Server". + +## Building from Source + +### Prerequisites + +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. + +- **Raylib**: https://github.com/raysan5/raylib +- **Lua**: https://github.com/lua/lua or https://github.com/LuaJIT/LuaJIT +- **CMake**: https://cmake.org/download/ +- **Build tools**: MinGW (Windows), GCC/Make (Linux) + +**Note:** Lua header files are from Lua 5.4.0. If using a different version, replace them. ### Windows -* Download "w64devkit" from https://github.com/skeeto/w64devkit and "CMake" from https://cmake.org/download/. Install CMake with path environment variables set. -* Download Raylib source. -* Run "w64devkit.exe" and navigate( ls == dir ) to "raylib/src" folder and run... +#### 1. Install Tools -``` +- Download **w64devkit** from https://github.com/skeeto/w64devkit +- Download **CMake** from https://cmake.org/download/ (install with PATH environment variables set) + +#### 2. Build Raylib + +```bash +# 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\ ``` -* You should now have "libraylib.a" file in that folder. -* Copy that to "ReiLua/lib" folder. -* Download Lua source from https://github.com/lua/lua -* Make following changes to Lua's makefile so we can build on Windows. +#### 3. Build Lua -``` +Download Lua source from https://github.com/lua/lua + +Modify Lua's makefile: + +```makefile +# Change this: MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -DLUA_USE_READLINE -# to +# To this: MYCFLAGS= $(LOCAL) -std=c99 -# And comment out or remove line. +# Comment out or remove: MYLIBS= -ldl -lreadline ``` -* Navigate "w64devkit" to Lua folder and build using. +Build: +```bash +# In w64devkit, navigate to Lua folder +mingw32-make + +# Copy liblua.a to ReiLua/lib folder +copy liblua.a path\to\ReiLua\lib\ +``` + +#### 4. Build ReiLua +**Quick Method (Recommended):** +```bash +cd ReiLua +build_dev.bat ``` + +**Manual Method:** +```bash +cd ReiLua\build +cmake -G "MinGW Makefiles" .. mingw32-make ``` -* There should now be "liblua.a" file in Lua folder. -* Copy that also to "ReiLua/lib" folder. -* Navigate to "ReiLua/build" folder on "w64devkit" and run... +#### 5. Test +```bash +cd build +ReiLua.exe ..\examples\snake\ ``` -cmake -G "MinGW Makefiles" .. -# Cmake uses NMake Makefiles by default so we will set the Generator to MinGW with -G +If you see a low-res snake racing off the window, success! Press Enter to reset. -mingw32-make +### Linux + +#### 1. Install Dependencies + +```bash +sudo apt install build-essential cmake ``` -* You should now have "ReiLua.exe". +#### 2. Build Raylib and Lua + +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. -Run example. +#### 3. Build ReiLua +**Quick Method (Recommended):** +```bash +cd ReiLua +chmod +x build_dev.sh +./build_dev.sh ``` -./ReiLua.exe ../examples/snake/ + +**Manual Method:** +```bash +cd ReiLua/build +cmake .. +make ``` -If you now see extremely low res snake racing off the window then you are successfull. Congratulations! You can reset the game by pressing enter. +#### 4. Test + +```bash +./ReiLua ../examples/snake/ +``` ### MacOS -Not tested, but I guess it should work similarly to Linux. +Not tested, but should work similarly to Linux. ### Raspberry Pi -Works best when Raylib is compiled using PLATFORM=DRM. See Raylib build instructions for Raspberry Pi. -Compile ReiLua with. -``` +Works best when Raylib is compiled using `PLATFORM=DRM`. See Raylib build instructions for Raspberry Pi. + +Compile ReiLua with: +```bash cmake .. -DDRM=ON ``` -Note that DRM should be launched from CLI and not in X. -### Web +**Note:** DRM should be launched from CLI, not in X. -Compile Raylib for web by following it's instructions. https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)#1-install-emscripten-toolchain +### Web (Emscripten) -Lua can be compiled by making few changes to it's makefile. -``` +Compile Raylib for web following its instructions: https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5) + +#### 1. Compile Lua for Web + +Modify Lua's makefile: + +```makefile +# Change: MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -DLUA_USE_READLINE -# to +# To: MYCFLAGS= $(LOCAL) -std=c99 +# Change: MYLIBS= -ldl -lreadline -# to +# To: MYLIBS= -ldl +# Change: CC= gcc -# to +# To: CC= emcc +# Change: CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common -march=native -# to +# To: CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common +# Change: AR= ar rc -# to +# To: AR= emar -# And a little bit more down. - $(AR) $@ $? -# to - $(AR) rcs $@ $? +# Change: +$(AR) $@ $? +# To: +$(AR) rcs $@ $? ``` -* If your enviromental variables for "emsdk" are correct, you should be able to compile with make. -* You should now have "libraylib.a" and "liblua.a" librarys. -* Put them into "ReiLua/lib/web/". -* Navigate into "ReiLua/build/". +Build with `make` if emsdk environmental variables are correct. + +#### 2. Prepare Libraries -Emscripten builds the resources like lua files and images to "ReiLua.data" file so we will create folder called "resources" that should include all that. "resources" should also be included in all resource paths. "main.lua" should be located in the root of that folder. So we should now have. +Put `libraylib.a` and `liblua.a` into `ReiLua/lib/web/`. +#### 3. Create Resources Folder + +```bash +cd ReiLua/build +mkdir resources +# Copy main.lua to resources/ +# Copy assets to resources/ +``` + +Structure: ``` -ReiLua - \build - |\resources - ||\main.lua +ReiLua/ +└── build/ + └── resources/ + ├── main.lua + └── assets/ ``` -We can now build the game. You can use the command in the top of the "CMakeLists.txt" to use emsdk toolchain with cmake. Remember to replace \<YOUR PATH HERE> with correct path. +#### 4. Build -``` -cmake .. -DCMAKE_TOOLCHAIN_FILE=<YOUR PATH HERE>/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DPLATFORM=Web +```bash +cd build +cmake .. -DCMAKE_TOOLCHAIN_FILE=<YOUR_PATH>/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DPLATFORM=Web make ``` -You should now have "ReiLua.html", "ReiLua.js", "ReiLua.wasm" and "ReiLua.data". You can test the game by creating localhost with Python. +#### 5. Test -``` +```bash python -m http.server 8080 ``` -You should now be able to access the webpage from browser. +Access in browser: `localhost:8080/ReiLua.html` + +## Complete Release Workflow + +### Step 1: Prepare Your Game + +``` +MyGame/ +├── main.lua +├── player.lua +├── enemy.lua +├── assets/ +│ ├── player.png +│ ├── enemy.png +│ └── music.wav +``` + +### Step 2: Copy Files to Build Directory + +```bash +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 +``` + +### Step 3: Build Release + +```bash +cd .. +build_release.bat +# Or: ./build_release.sh on Linux +``` + +### Step 4: Test + +```bash +cd build +ReiLua.exe --log +``` + +Verify: +- ✅ No file loading errors +- ✅ Game runs correctly +- ✅ All assets load properly + +### Step 5: Distribute + +```bash +mkdir Distribution +copy ReiLua.exe Distribution\YourGameName.exe +``` + +Your game is now a single executable ready for distribution! + +## Customizing Your Executable + +### Change Executable Name + +Edit `CMakeLists.txt`: +```cmake +project( YourGameName ) # Change from "ReiLua" +``` + +### Add Custom Icon + +Replace `icon.ico` with your own icon file, then rebuild. + +### Edit Executable Properties + +Edit `resources.rc`: +```rc +VALUE "CompanyName", "Your Studio Name" +VALUE "FileDescription", "Your Game Description" +VALUE "ProductName", "Your Game Name" +VALUE "LegalCopyright", "Copyright (C) Your Name, 2025" +``` + +### Customize Splash Screens + +Edit `src/splash.c`: +```c +const char* text = "YOUR STUDIO NAME"; // Change this +``` + +Replace logos: +```bash +# Replace these files before building +logo/raylib_logo.png +logo/reilua_logo.png +``` + +## Setting Up Zed Editor + +Zed is a modern, high-performance code editor. Here's how to set it up for ReiLua development: + +### Install Zed + +Download from: https://zed.dev/ + +### Setup Lua Language Support + +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 + +### Configure for ReiLua + +Create `.zed/settings.json` in your project root: + +```json +{ + "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 ReiLua API Definitions + +Copy `ReiLua_API.lua` to your project folder. This provides autocomplete and documentation for all ReiLua functions. +```bash +copy path\to\ReiLua\ReiLua_API.lua your_game\ ``` -localhost:8080/ReiLua.html + +### Keyboard Shortcuts + +Useful Zed shortcuts for Lua development: + +- `Ctrl+P` / `Cmd+P` - Quick file search +- `Ctrl+Shift+F` / `Cmd+Shift+F` - Search in files +- `Ctrl+.` / `Cmd+.` - Code actions +- `F12` - Go to definition +- `Shift+F12` - Find references +- `Ctrl+Space` - Trigger autocomplete + +### Extensions + +Install useful extensions: +1. Press `Ctrl+Shift+X` / `Cmd+Shift+X` +2. Search and install: + - **Lua** - Syntax highlighting and language support + - **Better Comments** - Enhanced comment highlighting + - **Error Lens** - Inline error display + +### Workspace Setup + +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. + +### Debugging + +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: + +```lua +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!") ``` + +### Terminal Integration + +Run ReiLua directly from Zed's terminal: + +1. Press `` Ctrl+` `` / `` Cmd+` `` to open terminal +2. Run your game: +```bash +path\to\ReiLua.exe --log --no-logo +``` + +### Tips for ReiLua Development in Zed + +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 + +## Documentation + +### Comprehensive Guides + +- **[EMBEDDING.md](EMBEDDING.md)** - Complete guide to embedding Lua and assets +- **[ASSET_LOADING.md](ASSET_LOADING.md)** - Asset loading API and loading screen documentation +- **[SPLASH_SCREENS.md](SPLASH_SCREENS.md)** - Splash screen customization guide +- **[BUILD_SCRIPTS.md](BUILD_SCRIPTS.md)** - Build scripts documentation +- **[API.md](API.md)** - Complete API reference (1000+ functions) +- **[UPGRADE_SUMMARY.md](UPGRADE_SUMMARY.md)** - Technical details of enhancements + +### Quick References + +- **API.md** - All ReiLua/Raylib functions +- **ReiLua_API.lua** - Lua annotations for IDE autocomplete +- **examples/** - Example games and demos + +## Troubleshooting + +### Common Issues + +**Game doesn't start:** +- Run with `--log` to see error messages +- Check that `main.lua` exists +- Verify all required assets exist + +**Assets not loading:** +- Check file paths (use forward slashes or escaped backslashes) +- Verify files exist in the correct location +- Use `--log` to see loading errors + +**Splash screens don't show:** +- Check you're not using `--no-logo` flag +- Verify build completed successfully +- Rebuild project: `cmake --build . --config Release` + +**Lua files not embedded:** +- Ensure Lua files are in `build/` directory before building +- Check `main.lua` exists +- Verify `-DEMBED_MAIN=ON` was used + +**Assets not embedded:** +- Create `build/assets/` folder +- Copy assets before building +- Verify `-DEMBED_ASSETS=ON` was used + +**Build fails:** +- Check CMake and compiler are installed and in PATH +- Verify `libraylib.a` and `liblua.a` are in `lib/` folder +- Try clean build: `build_dev.bat clean` + +### Getting Help + +1. 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 + +## Contributing + +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 + +## License + +ReiLua is licensed under the zlib/libpng license. See LICENSE file for details. + +### Third-Party Licenses + +- **Raylib** - zlib/libpng license +- **Lua** - MIT license +- **Oleaguid Font** - Check font documentation for licensing + +## Contact & Links + +- **Original ReiLua**: https://github.com/Gamerfiend/ReiLua +- **Raylib**: https://github.com/raysan5/raylib +- **Lua**: https://www.lua.org/ + +## Version Information + +- **ReiLua Version**: Based on original ReiLua with enhancements +- **Raylib Version**: 5.5 +- **Lua Version**: 5.4 + +--- + +**Happy Game Development! 🎮** diff --git a/SPLASH_SCREENS.md b/SPLASH_SCREENS.md index 8fb9b51..eb28565 100644 --- a/SPLASH_SCREENS.md +++ b/SPLASH_SCREENS.md @@ -1,12 +1,12 @@ # Splash Screens -ReiLua includes a built-in splash screen system that displays three professional splash screens before your game loads. This gives your game a polished, professional appearance right from startup. +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. ## Overview When you run your ReiLua game, it automatically shows two splash screens in sequence: -1. **"INDRAJITH MAKES GAMES"** - Clean, bold text on Raylib red background (similar to Squid Game style) +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: @@ -24,7 +24,7 @@ The logo images are **always embedded** into the executable in both development - ✅ No external logo files needed - ✅ Consistent splash screens across all builds - ✅ No risk of missing logo files -- ✅ Professional appearance from the start +- ✅ Clean appearance from the start ### Asset Loading Integration @@ -36,7 +36,7 @@ The splash screens display **before** your game's asset loading begins. This mea 4. Asset loading with progress indicator (if you use it) 5. Your game starts -This creates a smooth, professional startup experience. +This creates a smooth, polished startup experience. ## Skipping Splash Screens (Development) @@ -90,13 +90,13 @@ No manual steps required - it just works! ### Changing Splash Screen Text -To change "INDRAJITH MAKES GAMES" to your studio name: +To change the default text to your studio name: 1. Open `src/splash.c` -2. Find the `drawIndrajithSplash()` function -3. Change this line: +2. Find the splash drawing function +3. Change the text line: ```c - const char* text = "INDRAJITH MAKES GAMES"; + const char* text = "YOUR STUDIO NAME"; ``` 4. Rebuild the project @@ -152,7 +152,7 @@ ReiLua.exe MyGame/ **User Experience:** 1. **Splash Screen 1** (4.1 seconds) - - "INDRAJITH MAKES GAMES" bold text + - Custom text displayed in bold (default: "YOUR STUDIO NAME") - Red background (Raylib color #E62937) - Subtle zoom effect @@ -227,4 +227,4 @@ ReiLua --help --- -The splash screen system adds a professional touch to your ReiLua games with minimal effort. Customize it to match your studio's branding and give players a great first impression! +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! diff --git a/UPGRADE_SUMMARY.md b/UPGRADE_SUMMARY.md index 4c96a47..5cdfe8f 100644 --- a/UPGRADE_SUMMARY.md +++ b/UPGRADE_SUMMARY.md @@ -21,7 +21,7 @@ Successfully ported embedded assets, splash screens, and asset loading features ### 3. **Splash Screens** - Always embedded dual logo splash screens -- Screen 1: "INDRAJITH MAKES GAMES" on Raylib red background +- Screen 1: Custom text on Raylib red background - Screen 2: "Made using" with Raylib and ReiLua logos - Each screen: 0.8s fade in, 2.5s display, 0.8s fade out - `--no-logo` flag to skip in development @@ -141,7 +141,7 @@ cmake -G "MinGW Makefiles" .. -DEMBED_MAIN=ON -DEMBED_ASSETS=ON mingw32-make ``` - Everything embedded in single .exe -- Professional distribution package +- Clean distribution package - No external file dependencies ## Command Line Options diff --git a/ZED_EDITOR_SETUP.md b/ZED_EDITOR_SETUP.md new file mode 100644 index 0000000..7373a4e --- /dev/null +++ b/ZED_EDITOR_SETUP.md @@ -0,0 +1,579 @@ +# Setting Up Zed Editor for ReiLua Development + +Zed is a high-performance, modern code editor built for speed and collaboration. This guide shows you how to set up Zed for the best ReiLua game development experience. + +## Why Zed? + +- ⚡ **Fast**: Written in Rust, extremely responsive +- 🧠 **Smart**: Built-in AI assistance (optional) +- 🎨 **Beautiful**: Clean, modern interface +- 🔧 **Powerful**: LSP support, multi-cursor editing, vim mode +- 🆓 **Free**: Open source and free to use + +## Installation + +### Download Zed + +Visit https://zed.dev/ and download for your platform: + +- **Windows**: Download installer and run +- **Mac**: Download .dmg and install +- **Linux**: + ```bash + curl https://zed.dev/install.sh | sh + ``` + +### First Launch + +1. Launch Zed +2. Choose your theme (light/dark) +3. Select keybindings (VS Code, Sublime, or default) +4. Optional: Sign in for collaboration features + +## Setting Up for ReiLua + +### 1. Install Lua Language Server + +The Lua Language Server provides autocomplete, error detection, and documentation. + +**Method 1: Automatic (Recommended)** +1. Open Zed +2. Open any `.lua` file +3. Zed will prompt to install Lua support +4. Click "Install" + +**Method 2: Manual** +1. Press `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (Mac) +2. Type "zed: install language server" +3. Select "Lua" + +### 2. Create Workspace Configuration + +Create a `.zed` folder in your project root: + +```bash +cd your_game_project +mkdir .zed +``` + +### 3. Configure Lua Language Server + +Create `.zed/settings.json` with ReiLua-specific settings: + +```json +{ + "lsp": { + "lua-language-server": { + "settings": { + "Lua": { + "runtime": { + "version": "Lua 5.4", + "path": [ + "?.lua", + "?/init.lua" + ] + }, + "diagnostics": { + "globals": [ + "RL" + ], + "disable": [ + "lowercase-global" + ] + }, + "workspace": { + "library": [ + "ReiLua_API.lua" + ], + "checkThirdParty": false + }, + "completion": { + "callSnippet": "Both", + "keywordSnippet": "Both" + }, + "hint": { + "enable": true, + "setType": true + } + } + } + } + }, + "languages": { + "Lua": { + "format_on_save": "on", + "formatter": "language_server", + "tab_size": 4, + "hard_tabs": false + } + }, + "tab_size": 4, + "soft_wrap": "editor_width", + "theme": "One Dark", + "buffer_font_size": 14, + "ui_font_size": 14 +} +``` + +**What this does:** +- Sets Lua 5.4 runtime (matches ReiLua) +- Adds `RL` as a global (prevents "undefined global" warnings) +- Loads ReiLua_API.lua for autocomplete +- Enables format-on-save +- Sets tab size to 4 spaces +- Enables type hints +- Disables third-party library checking (reduces noise) + +### 4. Add ReiLua API Definitions + +Copy `ReiLua_API.lua` to your project: + +```bash +# Windows +copy path\to\ReiLua\ReiLua_API.lua your_game_project\ + +# Linux/Mac +cp path/to/ReiLua/ReiLua_API.lua your_game_project/ +``` + +This file provides: +- Autocomplete for all 1000+ ReiLua functions +- Function signatures +- Parameter hints +- Documentation tooltips + +### 5. Create Tasks Configuration + +Create `.zed/tasks.json` for quick commands: + +```json +{ + "tasks": [ + { + "label": "Run Game (Dev)", + "command": "path/to/ReiLua.exe", + "args": ["--log", "--no-logo"], + "cwd": "${workspaceFolder}" + }, + { + "label": "Run Game (Production)", + "command": "path/to/ReiLua.exe", + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "label": "Run Game with Logging", + "command": "path/to/ReiLua.exe", + "args": ["--log"], + "cwd": "${workspaceFolder}" + }, + { + "label": "Build Release", + "command": "path/to/ReiLua/build_release.bat", + "cwd": "path/to/ReiLua" + } + ] +} +``` + +**Usage:** +1. Press `Ctrl+Shift+P` / `Cmd+Shift+P` +2. Type "task: spawn" +3. Select your task + +Replace `path/to/ReiLua.exe` with the actual path to your ReiLua executable. + +## Essential Keyboard Shortcuts + +### Navigation + +| Shortcut | Action | Description | +|----------|--------|-------------| +| `Ctrl+P` / `Cmd+P` | Quick Open | Jump to any file instantly | +| `Ctrl+Shift+P` / `Cmd+Shift+P` | Command Palette | Access all commands | +| `Ctrl+T` / `Cmd+T` | Go to Symbol | Jump to function/variable | +| `F12` | Go to Definition | Jump to where something is defined | +| `Shift+F12` | Find References | Find all uses of a symbol | +| `Alt+←` / `Alt+→` | Navigate Back/Forward | Like browser navigation | +| `Ctrl+G` / `Cmd+G` | Go to Line | Jump to specific line number | + +### Editing + +| Shortcut | Action | Description | +|----------|--------|-------------| +| `Ctrl+D` / `Cmd+D` | Add Selection | Select next occurrence | +| `Alt+Click` | Add Cursor | Multiple cursors | +| `Ctrl+Shift+L` / `Cmd+Shift+L` | Select All Occurrences | Multi-cursor all matches | +| `Ctrl+/` / `Cmd+/` | Toggle Comment | Comment/uncomment line | +| `Alt+↑` / `Alt+↓` | Move Line Up/Down | Move current line | +| `Ctrl+Shift+D` / `Cmd+Shift+D` | Duplicate Line | Copy line below | +| `Ctrl+Shift+K` / `Cmd+Shift+K` | Delete Line | Remove entire line | +| `Ctrl+]` / `Cmd+]` | Indent | Indent selection | +| `Ctrl+[` / `Cmd+[` | Outdent | Unindent selection | + +### Search + +| Shortcut | Action | Description | +|----------|--------|-------------| +| `Ctrl+F` / `Cmd+F` | Find | Search in current file | +| `Ctrl+H` / `Cmd+H` | Replace | Find and replace | +| `Ctrl+Shift+F` / `Cmd+Shift+F` | Find in Files | Search entire project | +| `F3` / `Cmd+G` | Find Next | Next search result | +| `Shift+F3` / `Cmd+Shift+G` | Find Previous | Previous search result | + +### View + +| Shortcut | Action | Description | +|----------|--------|-------------| +| `Ctrl+\` / `Cmd+\` | Split Editor | Side-by-side editing | +| `` Ctrl+` `` / `` Cmd+` `` | Toggle Terminal | Show/hide terminal | +| `Ctrl+B` / `Cmd+B` | Toggle Sidebar | Show/hide file tree | +| `Ctrl+K Z` / `Cmd+K Z` | Zen Mode | Distraction-free mode | +| `Ctrl+K V` / `Cmd+K V` | Toggle Preview | For markdown files | + +### Code + +| Shortcut | Action | Description | +|----------|--------|-------------| +| `Ctrl+Space` | Trigger Autocomplete | Force show suggestions | +| `Ctrl+.` / `Cmd+.` | Code Actions | Quick fixes | +| `F2` | Rename Symbol | Rename variable/function | +| `Ctrl+K Ctrl+F` / `Cmd+K Cmd+F` | Format Selection | Format selected code | + +## Project Structure Best Practices + +### Recommended Layout + +``` +your_game/ +├── .zed/ +│ ├── settings.json +│ └── tasks.json +├── assets/ +│ ├── images/ +│ ├── sounds/ +│ └── fonts/ +├── lib/ +│ └── (your libraries) +├── src/ +│ ├── main.lua +│ ├── player.lua +│ ├── enemy.lua +│ └── game.lua +├── ReiLua_API.lua +└── README.md +``` + +### Using Multiple Folders + +Add ReiLua source for reference: + +1. File → Add Folder to Workspace +2. Select ReiLua source directory +3. Now you can reference ReiLua code easily + +## Advanced Features + +### Multi-Cursor Editing + +**Use cases:** +- Rename variables in multiple places +- Edit similar lines simultaneously +- Batch formatting + +**Example:** +1. Select a variable name +2. Press `Ctrl+D` repeatedly to select more occurrences +3. Type to edit all at once + +### Split Editor + +Work on multiple files simultaneously: + +1. Press `Ctrl+\` to split +2. Open different files in each pane +3. Example: `main.lua` on left, `player.lua` on right + +### Vim Mode (Optional) + +If you love Vim: + +1. `Ctrl+Shift+P` → "zed: toggle vim mode" +2. All Vim keybindings become available +3. Normal, Insert, Visual modes work +4. `:w` to save, `:q` to close, etc. + +### Live Grep + +Powerful project-wide search: + +1. Press `Ctrl+Shift+F` +2. Type your search query +3. Results show in context +4. Click to jump to location + +**Search tips:** +- Use regex with `.*` for patterns +- Search by file type: `*.lua` +- Exclude folders: Add to `.gitignore` + +### Collaboration (Optional) + +Share your coding session: + +1. Click "Share" button (top right) +2. Send link to teammate +3. Collaborate in real-time +4. See each other's cursors + +## Workflow Tips + +### 1. Quick File Switching + +``` +Ctrl+P → type filename → Enter +``` + +Example: `Ctrl+P` → "play" → selects `player.lua` + +### 2. Symbol Search + +``` +Ctrl+T → type function name → Enter +``` + +Example: `Ctrl+T` → "update" → jumps to `function RL.update()` + +### 3. Multi-File Editing + +1. `Ctrl+Shift+F` → Search for text +2. Results show all occurrences +3. Use multi-cursor to edit across files + +### 4. Integrated Terminal + +Keep terminal open while coding: + +1. `` Ctrl+` `` → Open terminal +2. Split view: code above, terminal below +3. Run `ReiLua.exe --log --no-logo` for testing + +### 5. Quick Testing Loop + +Set up this workflow: +1. Edit code in Zed +2. Save with `Ctrl+S` (autosave optional) +3. Switch to terminal with `` Ctrl+` `` +4. Press `↑` to recall previous command +5. Press `Enter` to run game + +## Troubleshooting + +### Lua Language Server Not Working + +**Problem**: No autocomplete or diagnostics + +**Solutions:** +1. Check LSP status: `Ctrl+Shift+P` → "lsp: show active servers" +2. Restart LSP: `Ctrl+Shift+P` → "lsp: restart" +3. Check `.zed/settings.json` syntax +4. Verify `ReiLua_API.lua` exists in project + +### ReiLua Functions Show as Undefined + +**Problem**: `RL.DrawText` shows as error + +**Solutions:** +1. Add `"RL"` to globals in `.zed/settings.json`: + ```json + "diagnostics": { + "globals": ["RL"] + } + ``` +2. Restart LSP + +### Format on Save Not Working + +**Problem**: Code doesn't format when saving + +**Solutions:** +1. Check formatter setting: + ```json + "languages": { + "Lua": { + "format_on_save": "on" + } + } + ``` +2. Ensure LSP is running +3. Try manual format: `Ctrl+Shift+F` + +### Tasks Not Showing + +**Problem**: Can't find run tasks + +**Solutions:** +1. Verify `.zed/tasks.json` exists +2. Check JSON syntax +3. Reload window: `Ctrl+Shift+P` → "zed: reload" + +## Themes and Appearance + +### Change Theme + +1. `Ctrl+Shift+P` → "theme selector: toggle" +2. Browse themes +3. Select one + +**Recommended for coding:** +- One Dark (dark) +- One Light (light) +- Andromeda (dark) +- GitHub Light (light) + +### Adjust Font Size + +**Method 1: Settings** +Edit `.zed/settings.json`: +```json +{ + "buffer_font_size": 14, + "ui_font_size": 14 +} +``` + +**Method 2: Quick Zoom** +- `Ctrl+=` / `Cmd+=` → Increase font +- `Ctrl+-` / `Cmd+-` → Decrease font +- `Ctrl+0` / `Cmd+0` → Reset font + +### Custom Font + +```json +{ + "buffer_font_family": "JetBrains Mono", + "buffer_font_size": 14 +} +``` + +**Recommended coding fonts:** +- JetBrains Mono +- Fira Code +- Cascadia Code +- Source Code Pro + +## Extensions and Enhancements + +### Install Extensions + +1. `Ctrl+Shift+X` / `Cmd+Shift+X` +2. Search for extensions +3. Click install + +### Recommended for Lua Development + +**Core:** +- ✅ Lua Language Server (built-in) + +**Productivity:** +- Better Comments - Enhanced comment highlighting +- Error Lens - Inline error display +- Bracket Pair Colorizer - Match brackets with colors + +**Optional:** +- GitHub Copilot - AI code suggestions (requires subscription) +- GitLens - Advanced git integration + +## Sample Workspace + +Here's a complete example setup: + +### Directory Structure +``` +MyGame/ +├── .zed/ +│ ├── settings.json +│ └── tasks.json +├── src/ +│ ├── main.lua +│ ├── player.lua +│ └── enemy.lua +├── assets/ +│ ├── player.png +│ └── music.wav +├── ReiLua_API.lua +└── README.md +``` + +### .zed/settings.json +```json +{ + "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", + "tab_size": 4 + } + }, + "theme": "One Dark", + "buffer_font_size": 14 +} +``` + +### .zed/tasks.json +```json +{ + "tasks": [ + { + "label": "Run Game", + "command": "C:/ReiLua/build/ReiLua.exe", + "args": ["--log", "--no-logo"] + } + ] +} +``` + +Now you can: +- Open project in Zed +- Get autocomplete for all RL functions +- Press `Ctrl+Shift+P` → "Run Game" to test +- Edit code with full LSP support + +## Tips for Efficient Development + +1. **Learn 5 shortcuts**: `Ctrl+P`, `Ctrl+Shift+F`, `Ctrl+D`, `F12`, `` Ctrl+` `` +2. **Use multi-cursor**: Speed up repetitive edits +3. **Split editor**: Work on related files side-by-side +4. **Keep terminal open**: Quick testing without leaving Zed +5. **Use Zen mode**: Focus during complex coding +6. **Enable autosave**: Never lose work + +## Next Steps + +✅ Install Zed +✅ Configure for Lua 5.4 +✅ Add ReiLua_API.lua to project +✅ Set up tasks for quick testing +✅ Learn essential shortcuts +✅ Start coding your game! + +## Additional Resources + +- **Zed Documentation**: https://zed.dev/docs +- **Zed GitHub**: https://github.com/zed-industries/zed +- **Community**: https://zed.dev/community +- **Keyboard Shortcuts**: View in Zed with `Ctrl+K Ctrl+S` + +--- + +Happy coding with Zed and ReiLua! 🚀 |
