debug.py

Debug overlay system - draggable panels, live inspector, and performance monitoring.

LOCATION: 'LunaEngine'/misc/debug.py

class DebugOverlay

Description

Base class for a draggable, fixable, closable debug panel.

Methods
def __init__(self: Any, engine: 'LunaEngine', x: int = 10, y: int = 10, width: int = 200, height: int = 100, title: str = '', background_color: Tuple[int, int, int, int] = (0, 0, 0, 180), header_color: Tuple[int, int, int, int] = (60, 60, 70, 220), text_color: Tuple[int, int, int] = (255, 255, 255)) -> None
No documentation
def refresh(self: Any, dt: float) -> None
No documentation
def render_content(self: Any, renderer: OpenGLRenderer) -> None
No documentation
def toggle_fixed(self: Any) -> None
No documentation
def close(self: Any) -> None
No documentation
def update(self: Any, dt: float, input_state: InputState) -> None
No documentation
def render(self: Any, renderer: OpenGLRenderer) -> None
No documentation

class FPSOverlay

Description

No documentation

Methods
def __init__(self: Any, engine: 'LunaEngine', x: int = 10, y: int = 10) -> None
No documentation
def refresh(self: Any, dt: float) -> None
No documentation
def render_content(self: Any, renderer: OpenGLRenderer) -> None
No documentation
def update(self: Any, dt: float, input_state: InputState) -> None
No documentation

class SceneStatsOverlay

Description

No documentation

Methods
def __init__(self: Any, engine: 'LunaEngine', x: int = 200, y: int = 10) -> None
No documentation
def refresh(self: Any, dt: float) -> None
No documentation
def render_content(self: Any, renderer: OpenGLRenderer) -> None
No documentation
def update(self: Any, dt: float, input_state: InputState) -> None
No documentation

class LogLevel

Description

No documentation

Attributes
INFO: Any = 0
WARNING: Any = 1
ERROR: Any = 2
DEBUG: Any = 3
Methods

No methods defined.

class LogEntry

Description

No documentation

Attributes
level: LogLevel = None
message: str = None
timestamp: float = field(default_factory=time.time)
Methods

No methods defined.

class ConsoleLogManager

Description

No documentation

Methods
def __init__(self: Any, max_logs: int = 200) -> Any
No documentation
def add_log(self: Any, level: LogLevel, message: str) -> None
No documentation
def clear(self: Any) -> None
No documentation
def get_filtered(self: Any) -> List[LogEntry]
No documentation

class LiveInspector

Description

No documentation

Methods
def __init__(self: Any, engine: 'LunaEngine', x: int = 100, y: int = 100) -> None
No documentation
def _setup_content(self: Any, engine: 'LunaEngine') -> Any
No documentation
def _setup_performance_tab(self: Any) -> Any
Create the performance monitoring tab without scrolling.
def _add_label(self: Any, text: Any, x: Any, y: Any, tab_name: Any, font_size: Any = None) -> Any
No documentation
def _add_value_label(self: Any, initial_text: Any, x: Any, y: Any, tab_name: Any) -> Any
No documentation
def _update_performance_tab(self: Any) -> Any
Refresh all performance metrics and hardware info.
def _get_cpu_model(self: Any) -> str
Extract a friendly CPU model name from platform.processor() or other sources.
def _get_gpu_info(self: Any) -> str
Extract clean GPU model name from OpenGL renderer string.
def _build_root_hierarchy(self: Any) -> Any
Reset stack and show top‑level UI elements from current scene.
def _build_hierarchy_view(self: Any, elements: List[UIElement]) -> Any
No documentation
def _navigate_back(self: Any) -> Any
Navigate back one level in hierarchy (with cooldown).
def _on_element_click_with_cooldown(self: Any, element: UIElement) -> Any
No documentation
def _on_element_click(self: Any, element: UIElement) -> Any
No documentation
def _show_element_properties(self: Any, element: UIElement) -> Any
No documentation
def getOverlays(self: Any) -> List[str]
No documentation
def _add_overlay(self: Any) -> Any
No documentation
def update_overlays_scrolling(self: Any) -> Any
No documentation
def set_debug_manager(self: Any, dm: 'DebugManager') -> Any
No documentation
def close(self: Any) -> Any
No documentation
def toggle_fixed(self: Any) -> Any
No documentation
def update(self: Any, dt: float, input_state: InputState) -> Any
No documentation

class DebugManager

Description

No documentation

Methods
def __init__(self: Any, engine: 'LunaEngine') -> None
No documentation
def add_overlay(self: Any, overlay: DebugOverlay) -> None
No documentation
def remove_overlay(self: Any, overlay: DebugOverlay, callback: Optional[Callable] = None) -> None
No documentation
def toggle_all(self: Any) -> None
No documentation
def update(self: Any, dt: float, input_state: InputState) -> None
No documentation
def render(self: Any, renderer: OpenGLRenderer) -> None
No documentation
Back to Misc Module