# GUIPageBuilder

class GUIPageBuilder<T : ForInventory>(type: GUIType<T>, page: Int)
Content copied to clipboard

## Functions

button
Link copied to clipboard
fun button(slots: InventorySlotCompound<T>, itemStack: ItemStack, onClick: (GUIClickEvent<T>) -> Unit)
Content copied to clipboard
A button is an item protected from any player actions.
changeGUI
Link copied to clipboard
fun changeGUI(slots: InventorySlotCompound<T>, icon: ItemStack, newGUI: () -> GUI<*>, newPage: Int? = null, onChange: (GUIClickEvent<T>) -> Unit? = null)
Content copied to clipboard
By pressing this button, the player switches to another GUI.
compoundScroll
Link copied to clipboard
fun compoundScroll(slots: InventorySlotCompound<T>, icon: ItemStack, compound: GUIRectSpaceCompound<T, *>, scrollTimes: Int = 1, scrollLines: Int = 1, reverse: Boolean = false)
Content copied to clipboard
By pressing this button, the user scrolls forwards or backwards in the compound.
fun compoundScroll(slots: InventorySlotCompound<T>, icon: ItemStack, compound: GUISpaceCompound<T, *>, scrollDistance: Int = 1, scrollTimes: Int = 1, reverse: Boolean = false)
Content copied to clipboard
By pressing this button, the user scrolls forwards or backwards in the compound.
compoundSpace
Link copied to clipboard
fun <E> compoundSpace(slots: InventorySlotCompound<T>, compound: GUISpaceCompound<T, E>)
Content copied to clipboard
Defines an area where the content of the given compound is displayed.
createCompound
Link copied to clipboard
fun <E> createCompound(iconGenerator: (E) -> ItemStack, onClick: (clickEvent: GUIClickEvent<T>, E) -> Unit? = null): GUISpaceCompound<T, E>
Content copied to clipboard
Creates a new compound, holding data which can be displayed in any compound space.
createRectCompound
Link copied to clipboard
fun <E> createRectCompound(fromSlot: SingleInventorySlot<out T>, toSlot: SingleInventorySlot<out T>, iconGenerator: (E) -> ItemStack, onClick: (clickEvent: GUIClickEvent<T>, E) -> Unit? = null): GUIRectSpaceCompound<T, E>
Content copied to clipboard
Creates a new compound, holding custom element data.
createSimpleCompound
Link copied to clipboard
fun createSimpleCompound(): GUISpaceCompound<T, GUICompoundElement<T>>
Content copied to clipboard
Creates a new compound, holding simple compound elements.
createSimpleRectCompound
Link copied to clipboard
fun createSimpleRectCompound(fromSlot: SingleInventorySlot<out T>, toSlot: SingleInventorySlot<out T>): GUIRectSpaceCompound<T, GUICompoundElement<T>>
Content copied to clipboard
Creates a new compound, holding simple compound elements.
freeSlot
Link copied to clipboard
fun freeSlot(slots: InventorySlotCompound<T>)
Content copied to clipboard
A free slot does not block any player actions.
nextPage
Link copied to clipboard
fun nextPage(slots: InventorySlotCompound<T>, icon: ItemStack, onChange: (GUIClickEvent<T>) -> Unit? = null)
Content copied to clipboard
This button always tries to find the next page if clicked, and if a next page exists it is loaded.
fun nextPage(slots: InventorySlotCompound<T>, icon: ItemStack, shouldChange: (GUIClickEvent<T>) -> Boolean? = null, onChange: (GUIClickEvent<T>) -> Unit? = null)
Content copied to clipboard
This button always tries to find the next page if clicked, and if a next page exists it is loaded.
pageChanger
Link copied to clipboard
fun pageChanger(slots: InventorySlotCompound<T>, icon: ItemStack, toPage: Int, onChange: (GUIClickEvent<T>) -> Unit? = null)
Content copied to clipboard
This is a button which loads the specified toPage if clicked.
fun pageChanger(slots: InventorySlotCompound<T>, icon: ItemStack, toPage: Int, shouldChange: (GUIClickEvent<T>) -> Boolean? = null, onChange: (GUIClickEvent<T>) -> Unit? = null)
Content copied to clipboard
This is a button which loads the specified toPage if clicked.
placeholder
Link copied to clipboard
fun placeholder(slots: InventorySlotCompound<T>, itemStack: ItemStack)
Content copied to clipboard
An item protected from any player actions.
previousPage
Link copied to clipboard
fun previousPage(slots: InventorySlotCompound<T>, icon: ItemStack, onChange: (GUIClickEvent<T>) -> Unit? = null)
Content copied to clipboard
This button always tries to find the previous page if clicked, and if a previous page exists it is loaded.
fun previousPage(slots: InventorySlotCompound<T>, icon: ItemStack, shouldChange: (GUIClickEvent<T>) -> Boolean? = null, onChange: (GUIClickEvent<T>) -> Unit? = null)
Content copied to clipboard
This button always tries to find the previous page if clicked, and if a previous page exists it is loaded.

## Properties

page
Link copied to clipboard
val page: Int
Content copied to clipboard
transitionFrom
Link copied to clipboard
var transitionFrom: PageChangeEffect? = null
Content copied to clipboard
transitionTo
Link copied to clipboard
var transitionTo: PageChangeEffect? = null
Content copied to clipboard