"EasyUIBuilder" is a small software tool designed to create JSON UI forms more quickly in Minecraft Bedrock Edition!
LAST FEATURE: Auto-building of server_form.json and _ui_defs.json.
wiki : https://github.com/GoldRush-developpement/EasyUIBuilder/wiki
PHP VERSION: 8.0 or >=
To get started with EasyUIBuilder, you need to include the library in your PHP project. You can do this using Composer:
composer require refaltor/easy-ui-builder
To create UI elements and generate JSON UI files, follow these steps:
use refaltor\ui\builders\Root;
use refaltor\ui\elements\Label;
use refaltor\ui\colors\BasicColor;
# others ...
$label = Label::create("test_label", "Hello EasyUIBuilder !");
$label->setColor(BasicColor::magenta());
$label->setFontSize(Label::FONT_EXTRA_LARGE);
$label->setFontType(Label::TYPE_MINECRAFT_TEN);
$root->addElement($label);
Generate and save the JSON UI file:
$root->generateAndSaveJson("path_to_ui_file.json");
$root = Root::create("common_test");
$panel = Panel::create("test_panel");
$panel->setSize(400, 200);
$panel->addChild(Label::create("title", "GoldRush")
->setFontType(Label::TYPE_MINECRAFT_TEN)
->setFontSize(Label::FONT_EXTRA_LARGE)
->setAnchorTo(Label::ANCHOR_TO_TOP_MIDDLE)
->setAnchorFrom(Label::ANCHOR_FROM_TOP_MIDDLE)
->setColor(BasicColor::yellow())
->setOffset(0, -45)
->setLayer(0)
->addChild(Label::create("title_shadow", "GoldRush")
->setFontType(Label::TYPE_MINECRAFT_TEN)
->setFontSize(Label::FONT_EXTRA_LARGE)
->setAnchorTo(Label::ANCHOR_TO_TOP_MIDDLE)
->setAnchorFrom(Label::ANCHOR_FROM_TOP_MIDDLE)
->setColor(BasicColor::black())
->setOffset(4, 2)
->setLayer(-1)
->setAlpha(0.7)
)
);
$panel->addChild(Image::create("background", "textures/ui/bg")
->setSizePercentage(100, 100)
->setAlpha(0.8)
);
$root->addElement($panel);
$root->generateAndSaveJson("ui/common_test.json");
result :