Gui

abstract class Gui : GuiScreen

Functions

Link copied to clipboard
fun addButton(button: GuiButton): Gui
fun addButton(buttonId: Int, x: Int, y: Int, width: Int = 200, height: Int = 20, buttonText: String): Gui

Add a base Minecraft button to the gui

Link copied to clipboard
fun clearButtons(): Gui
Link copied to clipboard
fun close()
Link copied to clipboard
open override fun doesGuiPauseGame(): Boolean

Internal method to run trigger. Not meant for public use

Link copied to clipboard
fun drawCreativeTabHoveringString(text: String, mouseX: Int, mouseY: Int)

Draws hovering text that follows the mouse

Link copied to clipboard
fun drawHoveringString(text: List<String>, x: Int, y: Int)

Draws hovering text that doesn't follow the mouse

Link copied to clipboard
open override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float)

Internal method to run trigger. Not meant for public use

Link copied to clipboard
fun drawString(text: String, x: Int, y: Int, color: Int)

Draws text on screen

Link copied to clipboard
fun getButton(buttonId: Int): GuiButton?
Link copied to clipboard
fun getButtonEnabled(buttonId: Int): Boolean
Link copied to clipboard
fun getButtonHeight(buttonId: Int): Int
Link copied to clipboard
fun getButtonVisibility(buttonId: Int): Boolean
Link copied to clipboard
fun getButtonWidth(buttonId: Int): Int
Link copied to clipboard
fun getButtonX(buttonId: Int): Int
Link copied to clipboard
fun getButtonY(buttonId: Int): Int
Link copied to clipboard
open override fun initGui()

Internal method to run trigger. Not meant for public use

Link copied to clipboard
fun isAltDown(): Boolean
Link copied to clipboard
fun isControlDown(): Boolean
Link copied to clipboard
fun isOpen(): Boolean
Link copied to clipboard
fun isShiftDown(): Boolean
Link copied to clipboard
open override fun onGuiClosed()

Internal method to run trigger. Not meant for public use

Link copied to clipboard
fun open()
Link copied to clipboard
fun registerActionPerformed(method: Any): RegularTrigger?

Registers a method to be run while gui is open. Registered method runs when an action is performed (clicking a button) Arguments passed through to method:

Link copied to clipboard
fun registerClicked(method: Any): RegularTrigger?

Registers a method to be run while gui is open. Registered method runs on mouse click. Arguments passed through to method:

Link copied to clipboard
fun registerClosed(method: Any): RegularTrigger?

Registers a method to be run when the gui is closed. Arguments passed through to method:

Link copied to clipboard
fun registerDraw(method: Any): RegularTrigger?

Registers a method to be run while gui is open. Registered method runs on draw. Arguments passed through to method:

Link copied to clipboard
fun registerKeyTyped(method: Any): RegularTrigger?

Registers a method to be run while gui is open. Registered method runs on key input. Arguments passed through to method:

Link copied to clipboard
fun registerMouseDragged(method: Any): RegularTrigger?

Registers a method to be run while gui is open. Registered method runs on key input. Arguments passed through to method:

Link copied to clipboard
fun registerMouseReleased(method: Any): RegularTrigger?

Registers a method to be run while gui is open. Registered method runs on mouse release. Arguments passed through to method:

Link copied to clipboard
fun registerOpened(method: Any): RegularTrigger?

Registers a method to be run when the gui is opened. Arguments passed through to method:

Link copied to clipboard
fun registerScrolled(method: Any): RegularTrigger?

Registers a method to be run while the gui is open. Registered method runs on mouse scroll. Arguments passed through to method:

Link copied to clipboard
fun removeButton(buttonId: Int): Gui

Removes a button from the gui with the given id

Link copied to clipboard
fun setButtonEnabled(buttonId: Int, enabled: Boolean): Gui

Sets the enabled state of a button

Link copied to clipboard
fun setButtonHeight(buttonId: Int, height: Int): Gui

Sets the button's height. Button textures break if the height is not 20

Link copied to clipboard
fun setButtonLoc(buttonId: Int, x: Int, y: Int): Gui

Sets the button's position

Link copied to clipboard
fun setButtonVisibility(buttonId: Int, visible: Boolean): Gui

Sets the visibility of a button

Link copied to clipboard
fun setButtonWidth(buttonId: Int, width: Int): Gui

Sets the button's width. Button textures break if the width is greater than 200

Link copied to clipboard
fun setButtonX(buttonId: Int, x: Int): Gui

Sets the button's x position

Link copied to clipboard
fun setButtonY(buttonId: Int, y: Int): Gui

Sets the button's y position

Link copied to clipboard
fun setDoesPauseGame(doesPauseGame: Boolean): Gui

Sources

Link copied to clipboard