Wunderlib Wiki › Guides › Build a Custom UI Layout Using the Grid System
Build a Custom UI Layout Using the Grid System
Understanding Grid-Based Positioning
WunderLib's grid-based UI layout system simplifies screen design by dividing your interface into a flexible grid. Instead of calculating pixel coordinates, you define how many grid cells wide and tall each element should be, and the system handles responsive scaling.
Creating Your Layout
Start by establishing a grid size appropriate for your screen. Add UI components (buttons, labels, text boxes) by specifying their grid position and dimensions. WunderLib handles alignment and spacing automatically, making layouts consistent across different screen resolutions.
Advantages
- Responsive design that adapts to various screen sizes
- Easier to maintain and modify layouts without recalculating positions
- Consistent spacing and alignment across your mod's interfaces
- Less boilerplate code compared to manual coordinate management
Use this system for any custom screens your mod needs, from settings panels to information displays.