Class ShapeComponent
Rectangular retained surface clipped to an authored shape.
The component reuses RenderLib's retained clip compositor, so its box paint, descendants, transforms, effects, and pointer hit region follow the configured silhouette. Ordinary box borders are still authored around the rectangular box and therefore do not trace concave interior edges.
Without a configured shape this component behaves like a
RectangleComponent.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCorner occupied by the two arms of an elbow preset. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionelbow(float thickness, ShapeComponent.ElbowCorner corner) Configures an elbow silhouette whose arms meet at the supplied corner.Clips this component to SVG-compatible path data.plus(float armThickness) Configures a centered plus silhouette.polygon(List<GuiClipPath.Point> points) Clips this component to a normalized border-box polygon.protected voidrenderSelf(com.render.api.gui.GuiRenderContext context) shape(GuiClipPath shape) Clips this component to an arbitrary retained clip shape.Methods 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, childLayout, 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, handlesMouseClick, handlesMouseScroll, height, height, height, hovered, id, id, indeterminate, indeterminate, inlineStyle, inset, inset, intrinsicSize, invalidateModernLayout, isClippingChildren, isFocusable, 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, onKeyPressed, onModernLayoutComplete, onMouseClicked, onMouseDragged, onMouseReleased, onMouseScrolled, opacity, order, orphans, outline, padding, padding, padding, pageName, paint, parent, pause, play, position, position, preferredHeight, preferredHeightForWidth, preferredWidth, pressed, pseudoElementBox, pseudoElementStyle, quotes, rangeState, rangeState, readOnly, readOnly, remove, removeStyleClass, renderChildren, renderClippedChildren, renderOverlay, requestFocus, required, required, resolveBaseProperties, resume, rowGap, scrollMargin, scrollMargin, scrollSnapStop, self, shadow, shouldRouteToChildren, size, size, startingStyle, stateProvider, styleAttribute, styleAttribute, styleClass, styleClasses, styledPseudoElements, styleOpen, styleState, styleState, tabIndex, tabIndex, tableLayout, tick, 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
-
ShapeComponent
public ShapeComponent()
-
-
Method Details
-
shape
Clips this component to an arbitrary retained clip shape.- Parameters:
shape- retained shape- Returns:
- this component
-
polygon
Clips this component to a normalized border-box polygon.- Parameters:
points- ordered polygon points using normalized box coordinates- Returns:
- this component
-
path
Clips this component to SVG-compatible path data.Path coordinates use design-space units relative to the component's border-box origin, matching
GuiClipPath.Path.- Parameters:
data- SVG-compatible path data- Returns:
- this component
-
plus
Configures a centered plus silhouette.- Parameters:
armThickness- normalized arm thickness in(0, 1]- Returns:
- this component
-
elbow
Configures an elbow silhouette whose arms meet at the supplied corner.- Parameters:
thickness- normalized arm thickness in(0, 1]corner- corner occupied by both arms- Returns:
- this component
-
renderSelf
protected void renderSelf(com.render.api.gui.GuiRenderContext context) - Overrides:
renderSelfin classGuiComponent<ShapeComponent>
-