Class ElementOutlines

java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.gui.components.ElementOutlines

public final class ElementOutlines extends Object
Outlines drawn around specific widgets, any AbstractWidget (vanilla's buttons, edit boxes, sliders or your own), without subclassing them. The outline is drawn right after the widget, only while it's visible.
ElementOutlines.set(button, Outline.rainbow().withThickness(2));
ElementOutlines.set(editBox, Outline.solid(0xFFFFAA00).withPadding(1), AbstractWidget::isFocused);
Widgets are held weakly, so a widget that's thrown away (its screen closed) drops its outline too. Call from the render thread.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
     
    static @Nullable Outline
    get(net.minecraft.client.gui.components.AbstractWidget widget)
     
    static boolean
    has(net.minecraft.client.gui.components.AbstractWidget widget)
     
    static void
    remove(net.minecraft.client.gui.components.AbstractWidget widget)
     
    static void
    set(net.minecraft.client.gui.components.AbstractWidget widget, Outline outline)
    Outlines the widget whenever it's drawn, replacing any outline it had.
    static void
    set(net.minecraft.client.gui.components.AbstractWidget widget, Outline outline, @Nullable Predicate<? super net.minecraft.client.gui.components.AbstractWidget> when)
    Outlines the widget whenever it's drawn and when holds, e.g.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • set

      public static void set(net.minecraft.client.gui.components.AbstractWidget widget, Outline outline)
      Outlines the widget whenever it's drawn, replacing any outline it had.
    • set

      public static void set(net.minecraft.client.gui.components.AbstractWidget widget, Outline outline, @Nullable @Nullable Predicate<? super net.minecraft.client.gui.components.AbstractWidget> when)
      Outlines the widget whenever it's drawn and when holds, e.g. AbstractWidget::isHoveredOrFocused.
    • remove

      public static void remove(net.minecraft.client.gui.components.AbstractWidget widget)
    • get

      @Nullable public static @Nullable Outline get(net.minecraft.client.gui.components.AbstractWidget widget)
    • has

      public static boolean has(net.minecraft.client.gui.components.AbstractWidget widget)
    • clear

      public static void clear()