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 class net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractWidget.WithInactiveMessageNested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
net.minecraft.client.gui.narration.NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe height of a color picker widgetstatic final intThe width of a color picker widgetFields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, message, packedFGColor, tooltip, UNSET_FG_COLOR, visible, width -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidenabled(boolean enabled) Marks a widget as enabled or disabled.voidextractWidgetContent(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float partialTicks) net.minecraft.network.chat.TextColorgetColor()Gets the current value of the color picker.booleanmouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean isDoubleClick) booleanmouseDragged(net.minecraft.client.input.MouseButtonEvent event, double dragX, double dragY) voidsetColor(net.minecraft.network.chat.TextColor color) Sets the current value of the color picker.voidsetResponder(Consumer<net.minecraft.network.chat.TextColor> responder) Sets a responder that is notified whenever the color changes.Methods inherited from class Panel
addRenderableOnly, addRenderableWidget, addWidget, charTyped, children, extractWidgetRenderState, getChildAt, getCurrentFocusPath, getFocused, isDragging, keyPressed, keyReleased, mouseReleased, mouseScrolled, nextFocusPath, setDragging, setFocused, setFocused, updateWidgetNarrationMethods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, createNarrationMessage, defaultButtonNarrationText, extractRenderState, extractScrollingStringOverContents, getAlpha, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, narrationPriority, onClick, onDrag, onRelease, playButtonClickSound, playDownSound, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
getBorderForArrowNavigation, isFocused, preeditUpdatedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getRectangle, isMouseOver, mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPositionMethods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratablesMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
WIDTH
public static final int WIDTHThe width of a color picker widget- See Also:
-
HEIGHT
public static final int HEIGHTThe height of a color 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 color picker. -
setColor
public void setColor(net.minecraft.network.chat.TextColor color) Sets the current value of the color picker. -
setResponder
-
extractWidgetContent
public void extractWidgetContent(@Nonnull net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float partialTicks) - Overrides:
extractWidgetContentin classPanel
-
mouseClicked
public boolean mouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean isDoubleClick) - Specified by:
mouseClickedin interfacenet.minecraft.client.gui.components.events.ContainerEventHandler- Specified by:
mouseClickedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
mouseClickedin classPanel
-
mouseDragged
public boolean mouseDragged(net.minecraft.client.input.MouseButtonEvent event, double dragX, double dragY) - Specified by:
mouseDraggedin interfacenet.minecraft.client.gui.components.events.ContainerEventHandler- Specified by:
mouseDraggedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
mouseDraggedin classPanel
-
enabled
-