factorio-rs-gui
factorio-rs-gui is an ecosystem crate: reactive builders, state! hooks,
and mount/install helpers on top of factorio-rs. It ships as both a Cargo
crate (authoring) and a Factorio library mod (runtime require).
| crates.io | factorio-rs-gui |
| Factorio mod | factorio-rs-gui |
| Source | ecosystem/factorio-rs-gui |
| Example | examples/gui_counter, examples/gui_widgets |
| Core docs | factorio-rs |
Start here
Section titled “Start here”- Getting started - dependency, first window, events
- Widgets - builders (Frame, Flow, Checkbox, …)
- Core GUI basics - imperative UI without reactivity
Guides
Section titled “Guides”| Guide | Topic |
|---|---|
| Getting started | First mount + events |
| State | state! hooks and rebuilds |
| Lifecycle | mount / install / events |
| Reactive GUI | End-to-end counter pattern |
| Multiple windows | Unique root_names |
Widgets
Section titled “Widgets”| Widget | Role |
|---|---|
Frame |
Titled container |
Flow |
Layout container |
ScrollPane |
Scrollable container |
Text |
Label |
Button / SpriteButton |
Clicks |
Checkbox / TextField / Slider / DropDown |
Interactive inputs |
ProgressBar / Sprite / Line / EmptyWidget |
Display / layout leaves |
Widget |
Enum + Into conversions |
Add the dependency
Section titled “Add the dependency”Cargo (typecheck + transpile):
[dependencies]factorio-rs-gui = "0.1"Factorio (runtime): install
factorio-rs-gui from the mod
portal and keep it enabled next to your mod. Building with the Cargo
dependency merges factorio-rs-gui >= … into your info.json via
[package.metadata.factorio] (Sharing code between mods).
Monorepo examples still use a path dependency; for apps, prefer crates.io.
Design notes
Section titled “Design notes”- Builders produce a concrete
Widgettree. state!(init)allocates a hook slot that survives rebuilds (per root name).mount/installown the Factorio lifecycle glue and wire GUI events viascript.on_event(no manual GUI event stubs).- Prefer
factorio_rs_gui::shared::...paths so Factoriorequires resolve against__factorio-rs-gui__/lua/....