Class SvgComponent
SVG-rendering component backed by files, raw strings, or the SVG builder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder(GuiSvgBuilder builder) Sets SVG content from a builder.document(GuiSvgDocument document) Sets a retained, dynamically styled SVG document.fit(GuiImageFit fit) Sets how the SVG fits the available content box.mirror(boolean mirrorHorizontal, boolean mirrorVertical) mirrorHorizontal(boolean mirrorHorizontal) mirrorVertical(boolean mirrorVertical) protected floatpreferredHeight(com.render.api.gui.GuiRenderContext context) protected floatpreferredWidth(com.render.api.gui.GuiRenderContext context) protected voidrenderSelf(com.render.api.gui.GuiRenderContext context) resource(net.minecraft.resources.Identifier resourceId) Sets an SVG resource source.rotationDegrees(float rotationDegrees) source(GuiSvgSource source) Sets the SVG source.Sets raw SVG markup.Sets an SVG URL source.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, preferredHeightForWidth, 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
-
SvgComponent
public SvgComponent()
-
-
Method Details
-
source
Sets the SVG source.- Parameters:
source- SVG source- Returns:
- this component
-
document
Sets a retained, dynamically styled SVG document.- Parameters:
document- retained SVG tree- Returns:
- this component
-
resource
Sets an SVG resource source.- Parameters:
resourceId- SVG resource identifier- Returns:
- this component
-
url
Sets an SVG URL source.- Parameters:
url- SVG URL- Returns:
- this component
-
svg
Sets raw SVG markup.- Parameters:
svg- SVG markup- Returns:
- this component
-
builder
Sets SVG content from a builder.- Parameters:
builder- SVG builder- Returns:
- this component
-
fit
Sets how the SVG fits the available content box.- Parameters:
fit- fit mode- Returns:
- this component
-
rotationDegrees
-
rotateClockwise90
-
rotateCounterClockwise90
-
rotate180
-
mirrorHorizontal
-
mirrorHorizontal
-
mirrorVertical
-
mirrorVertical
-
mirror
-
preferredWidth
protected float preferredWidth(com.render.api.gui.GuiRenderContext context) - Overrides:
preferredWidthin classGuiComponent<SvgComponent>
-
preferredHeight
protected float preferredHeight(com.render.api.gui.GuiRenderContext context) - Overrides:
preferredHeightin classGuiComponent<SvgComponent>
-
renderSelf
protected void renderSelf(com.render.api.gui.GuiRenderContext context) - Overrides:
renderSelfin classGuiComponent<SvgComponent>
-