Package org.moddingx.libx.screen
Class ColorPicker
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
org.moddingx.libx.screen.Panel
org.moddingx.libx.screen.ColorPicker
- All Implemented Interfaces:
net.minecraft.client.gui.components.events.ContainerEventHandler
,net.minecraft.client.gui.components.events.GuiEventListener
,net.minecraft.client.gui.components.Renderable
,net.minecraft.client.gui.components.TabOrderedElement
,net.minecraft.client.gui.layouts.LayoutElement
,net.minecraft.client.gui.narration.NarratableEntry
,net.minecraft.client.gui.narration.NarrationSupplier
,EditorOps
A widget that lets a user select a
colour
.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
net.minecraft.client.gui.narration.NarratableEntry.NarrationPriority
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The height of a colour picker widgetstatic final int
The width of a colour picker widgetFields inherited from class net.minecraft.client.gui.components.AbstractWidget
ACCESSIBILITY_TEXTURE, active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
enabled
(boolean enabled) Marks a widget as enabled or disabled.net.minecraft.network.chat.TextColor
getColor()
Gets the current value of the colour picker.boolean
mouseClicked
(double mouseX, double mouseY, int button) boolean
mouseDragged
(double mouseX, double mouseY, int button, double dragX, double dragY) void
render
(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) void
setColor
(net.minecraft.network.chat.TextColor color) Sets the current value of the colour picker.void
setResponder
(Consumer<net.minecraft.network.chat.TextColor> responder) Sets a responder that is notified whenever the colour changes.Methods inherited from class org.moddingx.libx.screen.Panel
addRenderableOnly, addRenderableWidget, addWidget, charTyped, children, getChildAt, getCurrentFocusPath, getFocused, isDragging, keyPressed, keyReleased, mouseReleased, mouseScrolled, nextFocusPath, renderWidget, setDragging, setFocused, setFocused, updateWidgetNarration
Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, clicked, createNarrationMessage, createTooltipPositioner, defaultButtonNarrationText, getFGColor, getHeight, getMessage, getRectangle, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, narrationPriority, onClick, onDrag, onRelease, playDownSound, renderScrollingString, renderScrollingString, renderTexture, setAlpha, setFGColor, setHeight, setMessage, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
isFocused, magicalSpecialHackyFocus
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getRectangle, isMouseOver, mouseMoved
Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPosition
Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
WIDTH
public static final int WIDTHThe width of a colour picker widget- See Also:
-
HEIGHT
public static final int HEIGHTThe height of a colour picker widget- See Also:
-
-
Constructor Details
-
ColorPicker
public ColorPicker(int x, int y) -
ColorPicker
-
-
Method Details
-
getColor
public net.minecraft.network.chat.TextColor getColor()Gets the current value of the colour picker. -
setColor
public void setColor(net.minecraft.network.chat.TextColor color) Sets the current value of the colour picker. -
setResponder
Sets a responder that is notified whenever the colour changes. -
render
public void render(@Nonnull net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) - Specified by:
render
in interfacenet.minecraft.client.gui.components.Renderable
- Overrides:
render
in classnet.minecraft.client.gui.components.AbstractWidget
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) - Specified by:
mouseClicked
in interfacenet.minecraft.client.gui.components.events.ContainerEventHandler
- Specified by:
mouseClicked
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
mouseClicked
in classPanel
-
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) - Specified by:
mouseDragged
in interfacenet.minecraft.client.gui.components.events.ContainerEventHandler
- Specified by:
mouseDragged
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
mouseDragged
in classPanel
-
enabled
public void enabled(boolean enabled) Description copied from interface:EditorOps
Marks a widget as enabled or disabled.
-