登陆 注册 QQ登陆
快捷导航
查看: 1|回复: 0

[模组分享] Minecraft Flex UI (Minecraft Flex UI)-MOD模组

[复制链接]

5257

主题

50

回帖

6491

积分

龙❁妻

Rank: 8Rank: 8

经验
6491 EP
金粒
1144 粒
绿宝石
20 块
爱心
0 点
发表于 2025-8-10 18:26:35 | 显示全部楼层 |阅读模式
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 回复 收起回复
小僵尸论坛感谢有你~
回复 论坛版权

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 手机动态码快速登录

本版积分规则



介绍

我的世界(Minecraft)小僵尸论坛
收录了来自各地的我的世界(MC)爱好者们的各种资源

须知: 切勿滥用举报,任何与举报相关的信息必须属实!

"Minecraft"以及"我的世界"为Mojang Synergies AB的商标 本站与Mojang以及微软公司没有从属关系

官方

新浪微博 腾讯微博 微信公众号 投稿规则 版权声明 捐助我们

官方QQ①群: 291907844 (点击加群)
官方QQ②群: 421312192
官方QQ③群: 528726532

我的世界(Minecraft)小僵尸论坛

新会员

QQ|Archiver|手机版|小黑屋|Minecraft(我的世界)小僵尸论坛 |网站地图

GMT+8, 2025-9-11 11:35 , Processed in 0.211138 second(s), 50 queries .

快速回复 返回顶部 返回列表