PandaHoloLib is a library which makes it easy to create interactive touchscreen menus for players.
-
Create interactive touch screens for your server.
-
Lots of flexibility, use your own methods for touchscreen interactivity.
-
Built-in support for PlaceHolderAPI and MVdWPlaceholderAPI.
-
Easy to use.
-
Bukkit or Spigot 1.9 or higher.
<repositories>
<repository>
<id>Rodepanda-repo</id>
<url>https://nexus.rodepanda.net/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.rodepanda</groupId>
<artifactId>PandaHoloLib</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
Creating a screen is very easy.
- First you create a Page for all your buttons and text.
Page page = new Page();
- Next you add a component. In this example we'll put a ButtonComponent in the middle that says "CLICK!" when a player clicks on it.
page.addComponent(new GuiButtonItemComponent(0.5, 0.5, true, "Click me", 0.3, Material.REDSTONE, p -> p.sendMessage("CLICK!") 0, true));
- Finally we'll create the actual screen by giving in the player the page the bottomleft corner in vector format, the top right corner in vector format and the update time in ticks.
Screen s = new Screen(player, page, bottomleft, bottomright, 2);
- Now the player can finally see his screen. Easy right?
To change the contents of a screen just create a new Page and put it in the new screen.
Holo.getPlayerScreen(p).setSlide(newPage);
You don't need to delete a screen after use, you can just unload it's current slide.
screen.unloadSlide();
Whenever a player logs out the screen will disable itself automatically.
For a full working example project you can take a look at HoloExample