ColorPickerButton
This page talks about ColorPickerButton class
This page talks about ColorPickerButton class
The class provides functionality for creating and displaying color picker buttons in Minecraft Fabric.
x
: The x position of the button.
y
: The y position of the button.
width
: The width of the button.
height
: The height of the button.
isPicking
: Whether the button is currently in picking mode.
Constructs a ColorPickerButton
object with the given position and size.
Renders this button on screen.
Handles mouse clicks on this button. This method sets the picking mode to true if the mouse is over the button and the left mouse button was clicked.
Returns whether this button is currently in picking mode.
Sets whether this button is currently in picking mode.
In this example, we create a new ColorPickerButton
with a position of (10, 10) and a size of (100, 20). We then render the ColorPickerButton
on screen using its render
method. We also handle mouse input by calling its onClick
method.
The ColorPickerButton is already called and present in . But if you still want to add it yourself somewhere you can do it by: