-
Notifications
You must be signed in to change notification settings - Fork 7
Button
Elysio Martins edited this page Nov 4, 2023
·
2 revisions

A button is a UI element that allows users to trigger an action or event when clicked. It often features customizable text and appearance.
- Instantiate the button:
$button = Button::create("button_one", $root);$panel = Panel::create("button_panel");
# very very VERY important to activate mapping of yours multiple buttons !
$panel->enableFactoryButton($root);
$button = Button::create("button_one", $root);
# title of your button in scripting API or pocketmine or other software tools ...
$button->setVisibleIfTitle("BUTTON_TITLE_TEST");
// others properties ...- Add the image to my root:
# Add the element to the root instance
$root->addElement($image);