@moxijs/ui - v0.3.5
    Preparing search index...

    Interface CardStyle

    Card Style Interface

    Implement this interface to create custom card visual styles. The CardPanel component uses this to render backgrounds, borders, title bars, and footers with consistent structure but different aesthetics.

    class PixelCardStyle implements CardStyle {
    drawBackground(g, dims, colors) {
    // Draw triple-border pixel-art background
    }
    // ... other methods
    }
    interface CardStyle {
        drawBackground(
            graphics: Graphics,
            width: number,
            height: number,
            colors: CardThemeColors,
        ): void;
        drawDragStrip(
            graphics: Graphics,
            dims: CardSectionDimensions,
            colors: CardThemeColors,
        ): void;
        drawFooter(
            graphics: Graphics,
            dims: CardSectionDimensions,
            colors: CardThemeColors,
        ): void;
        drawTitleBar(
            graphics: Graphics,
            dims: CardSectionDimensions,
            colors: CardThemeColors,
        ): void;
        getBorderInsets(): EdgeInsets;
        getContentPadding(): EdgeInsets;
        getDragStripHeight(): number;
        getFooterHeight(): number;
        getTitleBarHeight(hasTitle: boolean): number;
    }

    Implemented by

    Index

    Methods

    • Draw the card background (borders, shadows, main bg)

      Parameters

      • graphics: Graphics

        Graphics object to draw into

      • width: number

        Total card width

      • height: number

        Total card height

      • colors: CardThemeColors

        Theme colors to use

      Returns void

    • Get the height of the title bar in pixels

      Parameters

      • hasTitle: boolean

        Whether a title is set

      Returns number