HomeJavaModsShown!
Shown!

Shown!

Shown! is a widget-based UI library for Minecraft, allowing simple creation of interfaces for all sorts of purposes!

Screens

Just like Minecraft, you need to start with a Screen. The Screen is where your entire interface is created, and handled. The most basic screen can be created as follows:

public class ExampleScreen extends ShownScreen {
    public ExampleScreen() {
        super();
    }

    @Override
    protected void init() {
        super.init();
    }
}

When creating and adding widgets, you should make them in init(). Your call to super.init() should also always be at the bottom, as this runs the initialization for all of the added widgets, as well as updates the dimensions of each widget.

Widgets

Adding widgets is extremely simple, as well as how they function. First, we should go over how to position and scale them.

Widgets use a custom Vector class called UIVec to handle position and scale. UIVec has two values for each axis, scale and offset. Scale is the value of the axis relative to the parent widget, while offset is a constant value. An example of how this works can be shown here: Layout Example

As seen above, the entire width of the panel is 100px while the height of the box is only 80px. The elements contained within the panel are as follows:

Positioning and scaling widgets this way allows for exact relativity for all screen sizes, and also specific sized elements, such as a 20px tall header bar.

Using this understanding, placing a simple panel widget in the center of the screen that is half of the size in each axis can be done as follows:

@Override
protected void init() {
    PanelWidget panel = new PanelWidget(
            new UIVec(0.25, 0.25, 0, 0),
            new UIVec(0.5, 0.5, 0, 0)
    );
    this.addWidget(panel);

    super.init();
}
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more