Skip to content
stefvanschie edited this page May 20, 2022 · 2 revisions

Languages: Dutch (Nederlands)

PIN

Example code for a PIN gui. Players can enter their PIN code by clicking on the numbers in the top part of the gui.

Code

DropperGui gui = new DropperGui("PIN");

gui.setOnGlobalClick(event -> event.setCancelled(true));

Label input = new Label(0, 0, 3, 3, Font.LIGHT_GRAY);

input.setText("123456789", (character, item) -> new GuiItem(item, event -> {
    //player clicked on character
}));

gui.getContentsComponent().addPane(input);

XML

<droppergui title="PIN" onGlobalClick="cancelClick">
  <component name="contents">
    <label x="0" y="0" length="3" height="3" font="light_gray" text="123456789" onClick="characterClick" />
  </components>
</droppergui>
Clone this wiki locally