Dependencies
No dependencies
Download
- Windows
- macOS
- Binaries are not signed, so it requires to allow it running on your Mac in macOS settings.
- Linux
- Install from sources
How to use
- (All OS) Specify that directory via command line argument
C:/dev/fyrox_lua_sdk/fyroxed_lua.exe <path>
- (Windows only) Double-click on
C:/dev/fyrox_lua_sdk/fyroxed_lua.exe
icon and choose that directory in opened dialog window. - (Windows only) Drop that directory on the
C:/dev/fyrox_lua_sdk/fyroxed_lua.exe
icon in file explorer.
Game can be launched using Play button in editor. Also, game can be launched using
C:/dev/fyrox_lua_sdk/fyrox_lite_lua.exe c:/dev/my_lua_game
command.
Scripts
To emulate some OOP concepts, Lua Annotaions are used.
Following code defines a MyScript
class, inherited from Script
---@uuid 3e0d5f2b-6f9b-4c9a-a4fb-7cda5fae9d8d
---@class MyScript : Script
---@field velocity Vector3
---@field collider Node
---@field power number
MyScript = script_class()
function MyScript:on_update(dt)
end
Defined fields are accessible in editor UI and saved into scene files.
Inherit classes from NodeScript
to create scripts that can be attached to scene nodes in editor via dropdown on
Inspector
panel at the right. for @uuid
annotation value can be generated here.
Inherit from GlobalScript
to create singleton scripts. Unlike C# scripts, Lua global scripts require UUID.
Look into guards_cs project as an example.
Scripts Reloading
Editor reloads scripts metadata automatically after their change and window re-focusing. In-game hot reload works the same way.
Scenes & Assets
CLI
The fyroxed_lua.exe
can also be invoked via terminal with project path argument.
Install from sources
That's optional, because prebuilt binaries are available.
- Install latest Rust toolchain.
- (Windows only) Install Git Bash. Other MSYS2 distribution haven't tested.
- Checkout sources and install using shell command (use Git Bash on windows)
git clone https://github.com/kkolyan/fyrox_lite.git \ && cd fyrox_lite \ && chmod +x **/*.sh \ && ./bash/lua_install_sdk.sh <installation path>
<installation path>
now contains ready-to-use binaries.