Class Card

java.lang.Object
me.hackware.api.gui.Card

public final class Card extends Object
A rounded surface with a hairline border and optional cheap elevation — the base container for panels, list rows and editor sections in the Macros tab. The default fill mirrors the module panels' category background (colour and opacity) from the theme, so the tab matches the Modules tab surfaces.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Card corner radius in logical units.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    draw(UiContext ui, int x, int y, int w, int h)
     
    static void
    draw(UiContext ui, int x, int y, int w, int h, int radius, int fill, boolean elevated)
     
    static void
    draw(UiContext ui, int x, int y, int w, int h, int radius, int fill, boolean elevated, int border)
    draw(me.hackware.api.gui.UiContext, int, int, int, int) with an explicit border colour — so a host animating the card's opacity can fade the ring in step with the fill instead of leaving an opaque outline hanging over a half-faded surface.
    static int
    radiusPx(double res)
    RADIUS converted to physical pixels for the given res (physical-per-logical).

    Methods inherited from class java.lang.Object

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

    • RADIUS

      public static final int RADIUS
      Card corner radius in logical units. Scaled to physical pixels by the GUI res at draw time (see radiusPx(double)) so cards read equally round on any display / GUI scale — a fixed physical radius looks too round at low res and barely round on a high-DPI (Retina) screen.
      See Also:
  • Method Details

    • radiusPx

      public static int radiusPx(double res)
      RADIUS converted to physical pixels for the given res (physical-per-logical).
    • draw

      public static void draw(UiContext ui, int x, int y, int w, int h)
    • draw

      public static void draw(UiContext ui, int x, int y, int w, int h, int radius, int fill, boolean elevated)
    • draw

      public static void draw(UiContext ui, int x, int y, int w, int h, int radius, int fill, boolean elevated, int border)
      draw(me.hackware.api.gui.UiContext, int, int, int, int) with an explicit border colour — so a host animating the card's opacity can fade the ring in step with the fill instead of leaving an opaque outline hanging over a half-faded surface.