I have been working on a 'HelpMenu' the last two days for my server and i would like to add custom images to the form how would i do that? My Code: PHP: <?phpnamespace HelpMenu;use pocketmine\Server;use pocketmine\Player;use pocketmine\event\Listener;use pocketmine\plugin\Plugin;use pocketmine\plugin\Pluginbase;use pocketmine\command\CommandSender;use pocketmine\command\Command;use pocketmine\utils\TextFormat;use jojoe77777\FormAPI;use jojoe77777\FormAPI\SimpleForm;use jojoe77777\FormAPI\CustomForm;class HelpMenuUI extends PluginBase implements Listener { public function onEnable() { $this->getLogger()->info(TextFormat::GREEN . "By Tetro"); $this->getserver()->getPluginManager()->registerEvents($this,$this); } public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args) : bool { switch($cmd->getName()) { case "helpme": $this->openHelpForm($sender); break; } return true; } public function openHelpForm($sender) { $form = new SimpleForm(function (Player $sender, $data) { $result = $data; if ($result == null) { } switch ($result) { case 0: $this->openSkyBlockForm($sender); break; case 1: $this->openOreGeneratorForm($sender); break; case 2: $this->openSoulWellForm($sender); break; case 3: $this->openHelpfulCommandsForm($sender); break; } }); $form->setTitle(TextFormat::AQUA . "Help Menu"); $form->setContent(TextFormat::GREEN . "Select a category"); $form->addButton(TextFormat::AQUA . "SkyBlock"); $form->addButton(TextFormat::RED . "Ore Generators"); $form->addButton(TextFormat::YELLOW . "Soul Well"); $form->addButton(TextFormat::GOLD . "Helpful Commands"); $form->addButton(TextFormat::RED . "Exit"); $form->sendToPlayer($sender); return $form; } public function openSkyBlockForm($sender) { $form = new simpleForm(function (Player $sender, $data) { $result = $data; if($result == null) { } }); $form->setTitle(TextFormat::AQUA . "SkyBlock Help"); $form->setContent(TextFormat::GREEN . "Introduction:\n\nSkyBlock is a minigame where you spawn on a private island and you have to survive \n\nCommands:\n\n/is create\n/is visit\n/is tp\n/is name\n/is info\n/is ban\n/is setspawn\n/is rank\n/is top\n/is settings\n/is reset"); $form->addButton(TextFormat::RED . "Exit"); $form->sendToPlayer($sender); return $form; } public function openOreGeneratorForm($sender) { $form = new simpleForm(function (Player $sender, $data) { $result = $data; if($result == null) { } }); $form->setTitle(TextFormat::AQUA . "Ore generators Help"); $form->setContent(TextFormat::YELLOW . "Introduction:" . Textformat::GREEN . "\n\nOre generators are Ores that regen, they take 60 seconds to regen, they are obtainable through " . TextFormat::LIGHT_PURPLE . "/shop generators " . TextFormat::GREEN . "or from opening crates at " . TextFormat::LIGHT_PURPLE . "spawn" . TextFormat::GREEN . "."); $form->addButton(TextFormat::RED . "Exit"); $form->sendToPlayer($sender); return $form; } public function openSoulWellForm($sender) { $form = new simpleForm(function (Player $sender, $data) { $result = $data; if($result == null) { } }); $form->setTitle(TextFormat::AQUA . "Souls Help"); $form->setContent(TextFormat::YELLOW . "Introduction:" . TextFormat::GREEN . "\n\nSouls are shards that you can gain from killing other players and from crates at " . TextFormat::LIGHT_PURPLE . "spawn" . TextFormat::GREEN . ", you use the shards to gain rewards through decrypting Souls in the SoulWell at " . TextFormat::LIGHT_PURPLE . "spawn" . TextFormat::GREEN . "."); $form->addButton(TextFormat::RED . "Exit"); $form->sendToPlayer($sender); return $form; } public function openHelpfulCommandsForm($sender) { $form = new simpleForm(function (Player $sender, $data) { $result = $data; if($result == null) { } }); $form->setTitle(TextFormat::AQUA . "Helpful Commands"); $form->setContent(TextFormat::GREEN . "Commands: "); $form->addButton(TextFormat::RED . "Exit"); $form->sendToPlayer($sender); return $form; }}
just search your question befor posting here, i bleive i anwsered more than 3 times to this question in forum!!
PHP: /*** $form as Form **///path$form->addButton("Name", 0, "filepath");//url$form->addButton("Name", 1, "url");