Skip to content

🖥️ HUD, Diagnostics & UI Rendering

ParameterSpecification
Graphics Extraction Enginenet.minecraft.client.gui.GuiGraphicsExtractor
Target Screen Contextnet.minecraft.client.gui.screens.worldselection.AbstractGameRulesScreen
Hover Text Tint0xFFFFFFAA (Soft Yellow Highlight)
Default Text Tint0xFFFFFFFF (Crisp White)
Header Hover Box0x22FFFFFF (Subtle Alpha Overlay)
Category Separator Line0x44AAAAAA (Horizontal Border)
Toggle Active Color0x4400FF00 (Emerald Green)
Toggle Inactive Color0x44FF0000 (Ruby Red)
Accessibility NarrationNarratedElementType.TITLE (NarrationPriority.HOVERED)

📖 Overview

Minecraft 26.2 introduced major refactors to the client rendering pipeline, migrating standard GUI drawing operations to the modern GuiGraphicsExtractor subsystem.

Collapsible Game Rules is built natively for this rendering engine, utilizing direct vector color fills, font metrics centering, and accessibility narration output with zero frame-rate overhead.


🎨 Color Palette & Visual Diagnostics

Visual ComponentHex ARGB CodeVisual DescriptionUsage Location
Hover Fill0x22FFFFFF13% opacity white box overlay.Category header hover & Global actions hover.
Border Divider0x44AAAAAA27% opacity light gray 1px line.Bottom edge of category headers and global actions.
Hovered Text0xFFFFFFAASoft yellow highlighted text.Category header text & button labels on mouse hover.
Standard Text0xFFFFFFFF100% white text.Category header title & child count badge.
Child Count BadgeChatFormatting.GRAYVanilla gray text ( (N rules)).Suffix appended to category header labels.
Toggle Active BG0x4400FF0027% opacity emerald green.Background for ✔ ON state in BooleanToggleWidget.
Toggle Inactive BG0x44FF000027% opacity ruby red.Background for ✖ OFF state in BooleanToggleWidget.

💻 Rendering Implementation Details

Modern GuiGraphicsExtractor Pipeline

Inside CollapsibleCategoryRuleEntry.extractContent(...):

java
@Override
public void extractContent(GuiGraphicsExtractor graphics, int mouseX, int mouseY, boolean hovered, float a) {
    // 1. Premium Highlight on hover
    if (hovered) {
        graphics.fill(this.getX() - 2, this.getY(), this.getX() + this.getWidth() + 2, this.getY() + 24, 0x22FFFFFF);
    }

    // 2. Directional arrow, label, and child count badge
    String prefix = this.expanded ? "▼ " : "▶ ";
    Component countBadge = Component.literal(" (" + this.childCount + " rules)").withStyle(ChatFormatting.GRAY);
    Component display = Component.literal(prefix).append(this.label).append(countBadge);

    // 3. Centered text with dynamic hover tint
    graphics.centeredText(Minecraft.getInstance().font, display,
            this.getContentXMiddle(), this.getContentY() + 5, hovered ? 0xFFFFFFAA : 0xFFFFFFFF);
    
    // 4. Subtle separating line at the bottom
    graphics.fill(this.getX() + 10, this.getY() + 23, this.getX() + this.getWidth() - 10, this.getY() + 24, 0x44AAAAAA);
}

🔊 Audio & Accessibility Diagnostics

Whenever players interact with the UI, standard vanilla sounds provide tactile feedback:

  • Event: SoundEvents.UI_BUTTON_CLICK
  • Volume: 1.0F
  • Pitch: 1.0F
  • Trigger Conditions:
    • Mouse left or right click on Category Header.
    • Keyboard Space / Enter on Category Header.
    • Keyboard Left Arrow (collapse) or Right Arrow (expand).
    • Mouse click on [ Expand All ] or [ Collapse All ].

Official documentation & web portal for Dasik Igaijinn mods.