Перейти к содержимому
Mineforgian

Tau

A versatile and powerful UI Library for Minecraft that provides a flutter-like syntax for making UI

Загрузки
1K
Подписчики
4
Обновлён
26 мая 2024 г.
Лицензия
MIT

Опубликован 2 апреля 2023 г.

Summary

Tau is a UI library for Minecraft Forge that simplifies the process of creating graphical user interfaces (GUIs). It provides a Flutter-like syntax for creating and customizing the appearance of UI elements, making it easy for developers to create attractive, responsive, and functional interfaces.

Key Features

  • Flutter-like Syntax: Tau uses a syntax similar to that of Flutter, making it easy for developers familiar with Flutter to get started with Tau.
  • Extensible: Tau is designed to be extensible, allowing developers to add their own custom UI elements and widgets to the library.
  • Easy To Use: Tau is designed to be easy to use. I am personally really not a fan of the workflow that goes into making Minecraft UIs. Tau changes that workflow into a more organized and maintainable fashion (In my opinion).

Capabilities

Currently, there are 2 renderers for Tau. They are built upon existing Minecraft UI renderers. There is one for Screen and another one for Hud. So you can use Tau to build Huds and various different types of screens as you need. There is currently no support for making UI for containers (as of version 1.0.0). But that is something I would like to look into.

Example

Here are some example code that can be used to set up a simple Tau UI

public class ExampleUI implements UIComponent {
    @Override
    public UIComponent build(Layout layout) {
        return new Stack(
            new Container.Builder().withColor(Color.WHITE),
            new Center(new Sized(
                Size.staticSize(new Vector2i(100, 20)),
                new TextField.Builder()
                    .withMessage(new StringTextComponent("Hello"))
                    .withHintText(new StringTextComponent("Hello!")))
        ));
    }
}

in this snippet, it creates a list of UI elements that stack on top of each other. In this case, an empty container filled with the color white, and a text field with the size 100(w) 20(h) centred in the middle of the screen with a narration message of "Hello" and a hint text of "Hello!"

Lastly, This UI can be displayed onto the screen with 

Minecraft.getInstance().setScreen(new ScreenUIRenderer(new TestStatic()));

Getting Started

You can head to the documentation website here

Ченджлог

2.0.0Бета1.20.6 · 26 мая 2024 г.

v2.0.0 Neoforge-1.20.6 Major Update - Changes since Tau 1.0.3-1.19

API Changes

  • Vector2i renamed to SimpleVec2i
  • Theme signature changes to work with the new Minecraft GuiGraphics API
  • Removed ScaleTransform and TranslationTransform
  • Transformation is no longer an interface but a class
  • Added scale and translate methods to the Transform class to replace ScaleTransform and TranslationTransform
  • Transform component will now also transform inputs given to the children components
  • PrimitiveComponent#build will now take in a BuildContext instead of lists
  • Added ClientTooltipPositioner parameter to Tooltip
  • Added menu package
    • Adds container/menu support to Tau
    • Tau can now be used to create UI with inventories
    • Added new PlayerInventory and ItemSlot Component (These components will only function in a TauMenu)

Internal Changes

  • ListView no longer scrolls per child component and instead scrolls by a fixed amount
  • DynamicUIComponent no longer exposes dangerous fields
1.0.3-1.19Релиз1.19.4 · 5 ноября 2023 г.

1.0.3-1.19

Others

  • Updated to minecraft 1.19.4
1.0.2-1.19Релиз1.19.3 · 23 июля 2023 г.

v1.0.2-1.19 Update

Others

  • Updated the tooltip parameter of the Theme.drawTooltip method to take in a list of ClientTooltipComponent instead of FormattedText to increase the capabilities of Tooltips
  • Added withComponent method for adding ClientTooltipComponent to tooltips to Tooltip.Builder
1.0.2-1.18Релиз1.18.2 · 23 июля 2023 г.

v1.0.2-1.18 Update

Others

  • Updated the tooltip parameter of the Theme.drawTooltip method to take in a list of ClientTooltipComponent instead of FormattedText to increase the capabilities of Tooltips
  • Added withComponent method for adding ClientTooltipComponent to tooltips to Tooltip.Builder
1.0.1-1.18-HOTFIXРелиз1.18.2 · 16 июля 2023 г.

Excluded test

1.2.1Релиз1.16.3, 1.16.4, 1.16.5 · 16 июля 2023 г.

1.2.1-1.16 Minor Update

Others

  • Fixed ScreenUIRendere r not being able to be closed by e or escape key
1.0.1-1.19Релиз1.19.3 · 16 июля 2023 г.

1.0.1-1.19 Minor Update

Others

  • Fixed ScreenUIRenderer not being able to be closed by e or escape key
1.0.1-1.18Релиз1.18.2 · 16 июля 2023 г.

1.0.1-1.18 Minor Update

Others

  • Fixed ScreenUIRenderer not being able to be closed by e or escape key

Комментарии

Загружаем…