From 45c4c0e81fda33c3866776e918aea88beebe7d35 Mon Sep 17 00:00:00 2001 From: shacha086 <50512232+shacha086@users.noreply.github.com> Date: Tue, 26 Jul 2022 20:01:14 +0800 Subject: [PATCH] Update some GUI feature in readme.md (#52) * Update readme.md * Update readme.md --- readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index 5f46934f..319d5fe4 100644 --- a/readme.md +++ b/readme.md @@ -54,26 +54,26 @@ firstAsync { Inventories are great for viewing GUI information. However, they are not designed for developing GUIs. The KSpigot Inventory GUI API provides an easy way to build inventory GUIs the way you would expect such an API to be. In addition, -it offers full type safety for slots. +it offers full type safety for slots. Attention, the Slots is designed from bottom to top, so the page button will be at the bottom of GUI ```kotlin val gui = kSpigotGUI(GUIType.FIVE_BY_NINE) { - title = "Example Inventory" + title = literalText("Example Inventory") - page(0) { + page(1) { // slot ranges like rectTo or linTo reduce the amount of code placeholder(Slots.RowOneSlotOne rectTo Slots.RowFiveSlotNine, ItemStack(Material.RED_STAINED_GLASS)) nextPage(Slots.RowOneSlotNine, ItemStack(Material.PAPER)) } - page(1) { + page(2) { // define fancy transitions transitionFrom = PageChangeEffect.SLIDE_HORIZONTALLY transitionTo = PageChangeEffect.SLIDE_HORIZONTALLY // get special slot compounds easily with constants like Slots.Border placeholder(Slots.Border, ItemStack(Material.GLASS_PANE)) - + // page change buttons previousPage(Slots.RowTwoSlotTwo, ItemStack(Material.PAPER)) nextPage(Slots.RowTwoSlotEight, ItemStack(Material.PAPER)) @@ -88,7 +88,7 @@ val gui = kSpigotGUI(GUIType.FIVE_BY_NINE) { freeSlot(Slots.RowTwoSlotFive) } - page(2) { + page(3) { // placeholders are there to block any player action while displaying a specific item placeholder(Slots.RowOneSlotOne rectTo Slots.RowFiveSlotNine, ItemStack(Material.PINK_GLAZED_TERRACOTTA))