7 minutes
Ever wish you could tweak your game parameters in real-time without recompiling? Dat.GUI gives you sliders, dropdowns, and color pickers that connect directly to your component properties. No more guessing what the perfect jump height should be.
Let's build a system that automatically generates GUI controls for every entity and component in your scene.
The DatGui Component: Configuration Central
The DatGuiComponent holds our GUI instance and tracks folders for each entity. Unlike other components that live on individual entities, this one typically sits on your World entity to manage everything globally.
The DatGui System: Auto-Control Generator
Press 4 to toggle the entire GUI on and off. The system tracks folders and controls separately so we can organize everything hierarchically.
Initializing the GUI
When the DatGuiComponent loads, we create the main GUI instance and position it where requested. The GUI automatically becomes a floating panel that won't interfere with your game.
Auto-Generating Entity Controls
For each entity in the world, we create a folder. Then we dive into each component and create controls for their properties. Starting with folders closed keeps the interface manageable.
Smart Component Control Creation
Continue Reading
Unlock the full course to access all content and examples.