Skip to content

Debugging and Tips

ssbaxys edited this page Oct 26, 2026 · 1 revision

UI inspector, performance and common mistakes.

UI inspector (root.inspector())

root.inspector().enabled(true);         // now F8 opens and closes it
root.inspector().toggleKey(Keys.F12);   // a different key
root.inspector().open();

Off by default. An open inspector captures the mouse: hovering highlights an element (margins, bounds, padding) with a Class.style-classes#id label, a click selects, a right click clears the selection. A side panel shows the element tree (click a row to select, the wheel scrolls) and details of the selected element: Java class, position and size, padding/margin, flags and the computed style (only differences from the defaults). Arrow keys walk the tree (up goes to the parent), Esc closes, the header buttons close the panel and move it to the other side.

Rules and tips

  • Threading. The UI is single-threaded: create widgets and change signals on the client render thread.
  • Performance. Layout and styles are cached, invisible subtrees are skipped, and the animator does nothing when idle. Don't rebuild the tree every frame; change signals instead.
  • Drawing outside bounds. If a widget draws outside its bounds (glow, shadow), call setOverflowsBounds(true), otherwise it may be culled while scrolling.
  • Debugging. The UI inspector (root.inspector(), F8 in the showcase) shows the tree, sizes and styles.
  • Accessibility. root.accessibility(): color-blindness correction, text scale, reduced motion, focus narration.
  • Version portability. Code that uses io.github.ssbaxys.lumina.* (except the forge and neoforge packages) moves between Forge 1.20.1 and NeoForge 1.21.1 unchanged.

← Extending · English home · Architecture →

Clone this wiki locally