Class Outline
java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.utils.Outline
How a rectangular outline looks: a solid color or an animated
ColorGradient (a rainbow, or colors of your
own), its thickness, and how far it sits outside the rectangle. Immutable; the with... methods return copies.
Draw it yourself with draw(GuiGraphicsExtractor, ScreenRectangle), or attach it to a widget with
ElementOutlines.
For a gradient outline the spread is measured around the outline: 1 puts the whole
gradient once around it whatever its size, 2 puts it twice. The colors run clockwise from the top-left corner.
-
Method Summary
Modifier and TypeMethodDescriptionintcolor()voiddraw(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, int width, int height) Draws around the rectangle at (x,y) of the given size, grown by the padding.voiddraw(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.client.gui.navigation.ScreenRectangle rectangle) @Nullable ColorGradientThe gradient, or null for a solid outline.static Outlinegradient(ColorGradient gradient) A 1 pixel outline in an animated gradient; see the class docs for how its spread applies.intpadding()static Outlinerainbow()A 1 pixel outline with one full, animated rainbow around it.intstatic Outlinesolid(int color) A 1 pixel outline in one ARGB color.intwithColor(int color) A solid outline's color, or the alpha multiplier (its alpha byte) for a gradient outline.withPadding(int padding) Pixels between the rectangle and the outline; negative draws inside it.withSegmentLength(int segment) Length in pixels of each single-colored piece of a gradient outline (2 by default).withThickness(int thickness) Line width in pixels, at least 1.
-
Method Details
-
solid
A 1 pixel outline in one ARGB color. -
rainbow
A 1 pixel outline with one full, animated rainbow around it. -
gradient
A 1 pixel outline in an animated gradient; see the class docs for how its spread applies. -
withThickness
Line width in pixels, at least 1. -
withPadding
Pixels between the rectangle and the outline; negative draws inside it. -
withSegmentLength
Length in pixels of each single-colored piece of a gradient outline (2 by default). Longer pieces are fewer draws but show visible steps. -
withColor
A solid outline's color, or the alpha multiplier (its alpha byte) for a gradient outline. -
color
public int color() -
getGradient
The gradient, or null for a solid outline. -
thickness
public int thickness() -
padding
public int padding() -
segmentLength
public int segmentLength() -
draw
public void draw(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, int width, int height) Draws around the rectangle at (x,y) of the given size, grown by the padding.
-