Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Improperui Wiki › Guides › Create a Basic Custom UI Window

Create a Basic Custom UI Window

Setting Up Your First UI

To create a custom UI window, you'll need to define a script using the CSS-inspired syntax. Start by initializing the ImproperUI API in your mod code, then write a script that declares your UI structure.

Building the Layout

1. Define a container element that will serve as your window frame

2. Add child elements inside (buttons, labels, text inputs) using the hierarchical structure

3. Apply styling properties like width, height, background-color, and position to control appearance

4. Assign unique id attributes to elements you want to reference later

5. Use class attributes to group elements that share styling

Displaying Your UI

Once your script is written, call the render method during your mod's GUI tick event. The UI will appear on screen and respond to mouse input automatically. Use helper methods to query elements by ID or class name if you need to update them dynamically.

Test your layout by adjusting positioning and sizing values until the window appears where you want it. Remember that coordinates are relative to the parent container, making nested layouts easier to manage.