Class TButtonWidget
java.lang.Object
com.thecsdev.common.scene.Node<TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.commonmc.api.client.gui.widget.TClickableWidget
com.thecsdev.commonmc.api.client.gui.widget.TButtonWidget
- All Implemented Interfaces:
INode<TElement>, INodeBounded<TElement,Bounds2i>, INodeRenderable<TElement, TGuiGraphics>, Iterable<TElement>, Collection<TElement>
- Direct Known Subclasses:
TBlockStatsWidget, TButtonWidget.Flat, TButtonWidget.Paintable, TButtonWidget.Transparent, TDropdownWidget, TEntityStatsWidget, TItemStatsWidget, TSliderWidget, TTextualStatWidget, TToggleButtonWidget
A
TClickableWidget implementation that looks and behaves
like a regular button you'd see in-game's GUI.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTButtonWidgetwhose visual appearance is more flat and does not use the vanilla button texture.static classTButtonWidgetimplementation that allows you to customize its background and outline colors.static classTButtonWidgetthat does not have a visual appearance aside from its label and focus outline. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault horizontal padding that is applied to the button'sgetLabel().static final intDefault vertical padding that is applied to the button'sgetLabel().Fields inherited from class TClickableWidget
eClicked, ONCLICK_SOUNDFields inherited from class TElement
eInitialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal TLabelElementgetLabel()Returns theTLabelElementused by thisTButtonWidget.protected voidCallback method that is invoked when thisTElementis initializing.voidrenderCallback(@NotNull TGuiGraphics pencil) Callback method that is invoked when thisNodeis being rendered.Methods inherited from class TClickableWidget
click, clickCallback, dragEndCallback, dragStartCallback, enabledProperty, focusLostCallback, getCursor, hoverGainedCallback, inputCallback, isFocusable, postRenderCallback, pressedPropertyMethods inherited from class TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, findElementAt, focusableProperty, focusGainedCallback, forEachVisible, getBaseType, getBounds, getClient, getContentBounds, getSelf, getTooltip, hoverableProperty, hoverLostCallback, invalidateTooltipCache, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, removeRel, screenProperty, setBounds, setBounds, setBounds, showContextMenu, tickCallback, tooltipProperty, toString, visiblePropertyMethods inherited from class Node
add, addAll, childAddedCallback, childRemovedCallback, clear, contains, containsAll, equals, findChild, findParent, findSibling, forEach, get, getFirst, getLast, getParent, hashCode, indexOf, isEmpty, iterator, parentProperty, remove, remove, remove, removeAll, retainAll, rootProperty, size, toArray, toArray
-
Field Details
-
LBL_PAD_X
public static final int LBL_PAD_XDefault horizontal padding that is applied to the button'sgetLabel().- See Also:
-
LBL_PAD_Y
public static final int LBL_PAD_YDefault vertical padding that is applied to the button'sgetLabel().- See Also:
-
-
Constructor Details
-
TButtonWidget
public TButtonWidget()
-
-
Method Details
-
getLabel
Returns theTLabelElementused by thisTButtonWidget. Use this to customize the button overlay text. -
initCallback
-
renderCallback
Description copied from interface:INodeRenderableCallback method that is invoked when thisNodeis being rendered.- Specified by:
renderCallbackin interfaceINodeRenderable<TElement, TGuiGraphics>- Overrides:
renderCallbackin classTElement- Parameters:
pencil- The rendering context.
-