Class TCheckboxWidget
java.lang.Object
io.github.thecsdev.tcdcommons.api.client.gui.TElement
io.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
io.github.thecsdev.tcdcommons.api.client.gui.widget.TButtonWidget
io.github.thecsdev.tcdcommons.api.client.gui.widget.TCheckboxWidget
- All Implemented Interfaces:
TParentElement
,ITooltipProvider
,IEnableStateProvider
,IEnableStateProviderSetter
,ITextProvider
,ITextProviderSetter
-
Nested Class Summary
Nested classes/interfaces inherited from class io.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
TClickableWidget.TClickableWidgetEvent_Clicked
Nested classes/interfaces inherited from class io.github.thecsdev.tcdcommons.api.client.gui.TElement
TElement.TElementEvent_ChildAR, TElement.TElementEvent_ContextMenu, TElement.TElementEvent_Moved, TElement.TElementEvent_ParentChanged, TElement.TElementEvent_Resized
-
Field Summary
Modifier and TypeFieldDescriptionprotected HorizontalAlignment
protected boolean
protected int
protected int
static final net.minecraft.util.Identifier
static final net.minecraft.util.Identifier
static final net.minecraft.util.Identifier
protected boolean
protected HorizontalAlignment
static final net.minecraft.util.Identifier
protected int
protected int
Fields inherited from class io.github.thecsdev.tcdcommons.api.client.gui.widget.TButtonWidget
icon, iconColor, onClick, text
Fields inherited from class io.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
BUTTON_TEXTURE_SLICE_SIZE, BUTTON_TEXTURES, eClicked, enabled, T_WIDGETS_TEXTURE
Fields inherited from class io.github.thecsdev.tcdcommons.api.client.gui.TElement
alpha, eChildAdded, eChildRemoved, eContextMenu, eMoved, eParentChanged, eResized, height, SP_ALL, SP_INVOKE_EVENT, SP_MOVE_CHILDREN, SP_RELATIVE, SP_UPDATE_TOPMOST, SS_ALL, SS_INVOKE_EVENT, SS_UPDATE_TOPMOST, tooltip, tooltipPositioner, width, x, y, zOffset
Fields inherited from interface io.github.thecsdev.tcdcommons.api.client.gui.TParentElement
MAX_CHILD_NESTING_DEPTH
-
Constructor Summary
ConstructorDescriptionTCheckboxWidget
(int x, int y, int width, int height) TCheckboxWidget
(int x, int y, int width, int height, net.minecraft.text.Text text) TCheckboxWidget
(int x, int y, int width, int height, net.minecraft.text.Text text, boolean checked) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
final boolean
protected void
onClick()
Called when thisTClickableWidget
is clicked, either by a mouse or a keyboard input, or byTClickableWidget.click(boolean)
.void
render
(TDrawContext pencil) Renders this GUI element on the screen.void
setChecked
(boolean checked) final void
setHorizontalAlignment
(HorizontalAlignment forText, HorizontalAlignment forCheckbox) void
setShowText
(boolean showText) void
setText
(@Nullable net.minecraft.text.Text text) Methods inherited from class io.github.thecsdev.tcdcommons.api.client.gui.widget.TButtonWidget
getIcon, getIconColor, getOnClick, getText, renderBackground, renderIcon, setIcon, setIconColor, setIconColor, setOnClick
Methods inherited from class io.github.thecsdev.tcdcommons.api.client.gui.widget.TClickableWidget
click, getEnabled, input, isFocusable, setEnabled
Methods inherited from class io.github.thecsdev.tcdcommons.api.client.gui.TElement
canBeAddedTo, createContextMenu, getAlpha, getChildren, getHeight, getItemRenderer, getParent, getParentTElement, getParentTScreen, getTextRenderer, getTooltip, getTooltipPositioner, getWidth, getX, getY, getZIndex, getZOffset, isDragging, isEnabled, isEnabledAndVisible, isFocused, isFocusedOrHovered, isHoverable, isHovered, isVisible, move, moveChildren, next, postRender, previous, setAlpha, setPosition, setPosition, setSize, setSize, setTooltip, setZOffset, tick, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.thecsdev.tcdcommons.api.client.gui.TParentElement
addChild, addChild, clearChildren, findChild, findLastChild, findParent, findParentTElement, forEachChild, getEndX, getEndY, input, removeChild, removeChild
-
Field Details
-
SELECTED_HIGHLIGHTED_TEXTURE
public static final net.minecraft.util.Identifier SELECTED_HIGHLIGHTED_TEXTURE -
SELECTED_TEXTURE
public static final net.minecraft.util.Identifier SELECTED_TEXTURE -
HIGHLIGHTED_TEXTURE
public static final net.minecraft.util.Identifier HIGHLIGHTED_TEXTURE -
TEXTURE
public static final net.minecraft.util.Identifier TEXTURE -
checked
protected boolean checked -
showText
protected boolean showText -
textAlignment
-
checkboxAlignment
-
cX
protected int cX -
cY
protected int cY -
tX
protected int tX -
tY
protected int tY
-
-
Constructor Details
-
TCheckboxWidget
public TCheckboxWidget(int x, int y, int width, int height) -
TCheckboxWidget
public TCheckboxWidget(int x, int y, int width, int height, net.minecraft.text.Text text) -
TCheckboxWidget
public TCheckboxWidget(int x, int y, int width, int height, net.minecraft.text.Text text, boolean checked)
-
-
Method Details
-
getChecked
public final boolean getChecked() -
setChecked
public void setChecked(boolean checked) -
getShowText
public final boolean getShowText() -
setShowText
public void setShowText(boolean showText) -
onClick
protected void onClick()Description copied from class:TClickableWidget
Called when thisTClickableWidget
is clicked, either by a mouse or a keyboard input, or byTClickableWidget.click(boolean)
.- Overrides:
onClick
in classTButtonWidget
-
setText
public void setText(@Nullable @Nullable net.minecraft.text.Text text) - Specified by:
setText
in interfaceITextProviderSetter
- Overrides:
setText
in classTButtonWidget
-
setHorizontalAlignment
public final void setHorizontalAlignment(HorizontalAlignment forText, HorizontalAlignment forCheckbox) -
render
Description copied from interface:TParentElement
Renders this GUI element on the screen.- Specified by:
render
in interfaceTParentElement
- Overrides:
render
in classTButtonWidget
- Parameters:
pencil
- TheTDrawContext
.
-