-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Elysio Martins edited this page Nov 6, 2023
·
4 revisions
Welcome to the EasyUIBuilder project wiki. This wiki provides in-depth information on how to use, configure, and extend the EasyUIBuilder project, a PHP library for creating user interfaces.
git clone https://github.com/GoldRush-developpement/EasyUIBuilder
cd EasyUIBuilder/
- create root file in
refaltor/roots/
<?php
namespace refaltor\roots;
use refaltor\ui\builders\Root;
use refaltor\ui\builders\RootBuild;
use refaltor\ui\colors\BasicColor;
use refaltor\ui\elements\Label;
class LabelTest implements RootBuild
{
public function root(): Root
{
# create root instance
$root = Root::create();
# create my element
$label = Label::create("label_test", "Hello EasyUIBuilder !")
->setFontType(Label::TYPE_MINECRAFT_TEN)
->setFontSize(Label::FONT_EXTRA_LARGE)
->setColor(BasicColor::blue())
->setShadow();
# add element in root instance
$root->addElement($label);
# return root instance
return $root;
}
# namespace and .json file name
public function getNamespace(): string
{
return "ui_test";
}
# put the getPathName in your texture pack
# for the script to automatically generate the ui and
# the condition for the visible UI
# ---
# example put in your developpement_resources_pack in .com_mojang :)
public function getPathName(): string
{
return "./resources/pack_example/";
}
# title condition is very important because
# this is the title that makes your ui will become visible
public function titleCondition(): string
{
return "LABEL_TEST";
}
}
- register root file in
refaltor/ui/Entry.php
ilstartingService()
function
<?php
namespace refaltor\ui;
use refaltor\roots\LabelTest;
use refaltor\ui\builders\RootBuild;
use refaltor\ui\helpers\RegisterHelper;
class Entry extends RegisterHelper
{
public function startingService(): void {
# register root ui
$this->register(new LabelTest());
}
}
- start generation of your uis with the
start.cmd
orphp start.php