Class ToggleSwitchComponent
java.lang.Object
com.render.api.gui.GuiComponent<ContainerComponent>
com.render.api.gui.ContainerComponent
com.render.api.gui.PressableComponent<ToggleSwitchComponent>
com.render.api.gui.ToggleSwitchComponent
Animated on/off toggle switch with configurable track and knob styling.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivate()indeterminate(boolean indeterminate) Configures this switch as a tri-state mixed value for:indeterminate.initialValue(boolean value) Sets the value and immediately snaps the visual knob/track state without playing the value animation.knobColor(int knobArgb) Deprecated.knobColor(RenderColor knobColor) knobColors(RenderColor offColor, RenderColor onColor) knobRadius(float knobRadius) protected voidrenderSelf(com.render.api.gui.GuiRenderContext context) protected voidtick()trackBorderColors(RenderColor offColor, RenderColor onColor) trackOffColor(int trackOffArgb) Deprecated.trackOffColor(RenderColor trackOffColor) trackOnColor(int trackOnArgb) Deprecated.trackOnColor(RenderColor trackOnColor) booleanvalue()value(boolean value) Methods inherited from class PressableComponent
handlesMouseClick, isFocusable, onKeyPressed, onMouseClicked, onMouseReleased, onPress, selfTypedMethods inherited from class ContainerComponent
childLayout, flowColumn, flowRow, gap, layout, preferredHeight, preferredWidth, resolveBaseProperties, stackMethods inherited from class GuiComponent
activeStateStyle, add, alignContent, alignItems, alignSelf, anchor, anchorName, anchorPlacement, animatedBorder, animation, applyStyle, aspectRatio, autoHeight, autoSize, autoWidth, backdropFilters, backfaceVisibility, backgroundColor, backgroundColor, backgroundLayer, backgroundLayers, backgroundLayers, border, borderCollapse, borderColor, borderColor, borderSpacing, borderWidth, boxDecorationBreak, boxGlow, boxShadow, boxShadows, boxShadows, boxSizing, breakAfter, breakBefore, breakInside, cancel, captionSide, caretStyle, centered, childGap, childLayoutViewport, childOffsetX, childOffsetY, children, clearChildren, clipChildren, clipPath, clipsChildren, color, color, columnCount, columnFill, columnGap, columnRule, columnSpan, columnWidth, computedStyle, containsChildClipPoint, contextMenu, cornerRadius, defaultDisplay, dirtyCategories, disabled, display, emptyCells, enabled, enabled, filters, findById, findById, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, focused, focused, fragmentTree, glow, gradient, gridAutoFlow, gridPlacement, gridTemplate, handlesMouseScroll, height, height, height, hovered, id, id, indeterminate, inlineStyle, inset, inset, intrinsicSize, invalidateModernLayout, isClippingChildren, justifyContent, justifyItems, justifySelf, lastInvalidationReason, layoutChildren, layoutFragments, listStyleImage, listStylePosition, listStyleType, margin, margin, margin, marginBreak, markerGap, markerSide, maskLayers, maskLayers, matchesStyleState, maxHeight, maxWidth, minHeight, minWidth, motionPath, onCharTyped, onFocusChanged, onModernLayoutComplete, onMouseDragged, onMouseScrolled, opacity, order, orphans, outline, padding, padding, padding, pageName, paint, parent, pause, play, position, position, preferredHeightForWidth, pressed, pseudoElementBox, pseudoElementStyle, quotes, rangeState, rangeState, readOnly, readOnly, remove, removeStyleClass, renderChildren, renderClippedChildren, renderOverlay, requestFocus, required, required, resume, rowGap, scrollMargin, scrollMargin, scrollSnapStop, self, shadow, shouldRouteToChildren, size, size, startingStyle, stateProvider, styleAttribute, styleAttribute, styleClass, styleClasses, styledPseudoElements, styleOpen, styleState, styleState, tabIndex, tabIndex, tableLayout, tooltip, transform, transformBox, transformOrigin, transformStyle, transition, transition, transition, transition, transition, transition, transitionAll, transitionAll, transitionAll, translate, translateX, translateY, validity, validity, verticalAlign, viewTransitionName, viewTransitionName, visible, visible, widows, width, width, width, writeModernInline, writeTextShadow, writingState, x, x, y, y, zIndex
-
Constructor Details
-
ToggleSwitchComponent
public ToggleSwitchComponent()
-
-
Method Details
-
value
-
initialValue
Sets the value and immediately snaps the visual knob/track state without playing the value animation.- Parameters:
value- new value- Returns:
- this component
-
value
public boolean value() -
indeterminate
Configures this switch as a tri-state mixed value for:indeterminate.- Overrides:
indeterminatein classGuiComponent<ContainerComponent>- Parameters:
indeterminate- mixed state- Returns:
- this component
-
onChange
-
trackOffColor
-
trackOffColor
Deprecated. -
trackOnColor
-
trackOnColor
Deprecated. -
trackBorderColors
-
knobColor
-
knobColor
Deprecated. -
knobColors
-
knobRadius
-
activate
protected void activate()- Overrides:
activatein classPressableComponent<ToggleSwitchComponent>
-
tick
protected void tick()- Overrides:
tickin classGuiComponent<ContainerComponent>
-
renderSelf
protected void renderSelf(com.render.api.gui.GuiRenderContext context) - Overrides:
renderSelfin classContainerComponent
-
knobColor(RenderColor).