|
Minecraft Flex UI (Minecraft Flex UI)Github |相关wiki |源站链接支持: fabricImplement a Flex layout-based Minecraft GUI framework based on facebooks open source Yoga layout engine.
For ordinary players do not download the mod
In most cases the module is used by other module developers and is included in their mod Jar package
Description
Based on facebook open source Yoga layout engine implements the Minecraft GUI framework based on the Flex layout.
A subset of the Flex standard is implemented on top of Yoga and most of the CSS properties are implemented as well.
The design concept of MVC is adopted to realize the one-way and two-way data binding.
Developers can design and implement complex UI interfaces on top of this, and this project can be used as Yoga engine embedded in the game as a non-exhaustive reference implementation of the game layout engine.
Example
javapublic class WidgetTestScreen extends WidgetScreen {protected StringBuilderObservable text = new StringBuilderObservable();
public WidgetTestScreen() {
super(Text.of(\"test\"));
}
@Override
public void widget(ScreenWidget root) {
root.flexDirection.set(WidgetFlexDirection.Row)
.justifyContent.set(WidgetJustify.Center)
.alignItems.set(WidgetAlign.Center)
.child(new BoxWidget()
.background.set(RectDrawable.LIGHT_PANEL)
.child(new LabelWidget()
.text.binding(text.computed((StringBuilderObservable text) -> Text.of(text.getString())))
.margin(WidgetEdge.All, 4))
.child(new TextBoxWidget()
.text.binding(text))
.child(new ButtonWidget()
.click.on((mouse) -> close())
.child(new LabelWidget()
.text.set(Text.of(\"取消\"))))
);
}
}
Data Binding
By default all bindings from non-computed binding sources are bi-directional bindings.
Setting values for computed binding sources is ignored
*But most components will only operateone-wayon bound values*
截图:
https://i.sodamc.com/modrinth/BJlZBrlYIv.jpg?x-oss-process=style/forge2]
来自Modrinth所有游戏版本1.191.19.11.19.21.19.3所有类型fabricMinecraft Flex UI 0.0.1mfui-0.0.1.jar下载0.0.1#Alphamfui-0.0.1-sources.jar下载0.0.1#Alpha展开版本: 0.0.1支持游戏: 1.19, 1.19.1, 1.19.2, 1.19.3类型:FabricAlpha下载次数: 198全部版本
markdown_parsed
文章类型:收录
layui.use([\'form\'], function(){
var form = layui.form;
});
Minecraft Flex UI |
楼主
2025-8-10 18:26:35
回复(0)
收起回复
|