debug

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package debug provides the world-owned Panel used to show status readouts, recent messages, and built-in frame and tick rates in the development overlay.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builtin

type Builtin uint8

Builtin identifies a built-in rate readout in the debug overlay.

const (
	// FPS is the measured display frame rate.
	FPS Builtin = iota
	// TPS is the measured fixed-tick rate.
	TPS
)

type Panel

type Panel struct {
	// contains filtered or unexported fields
}

Panel stores status readouts and recent messages for the debug overlay.

Castrum provides it as a world resource. Use Panel.Status for persistent readouts and Panel.Message for the bounded message log. Access the panel from the engine goroutine; it is not safe for concurrent use.

func NewPanel

func NewPanel() *Panel

NewPanel returns a panel with all built-in rate readouts enabled and no messages or status lines.

func (*Panel) Clear

func (p *Panel) Clear()

Clear removes all messages and status slots without changing which built-in rate readouts are enabled.

func (*Panel) Enabled

func (p *Panel) Enabled(b Builtin) bool

Enabled reports whether b is enabled for display. Undefined values are always disabled.

func (*Panel) Lines

func (p *Panel) Lines() []string

Lines returns retained messages from oldest to newest. The returned slice is independent of the panel's storage.

func (*Panel) Message

func (p *Panel) Message(text string)

Message appends text to the message log, dropping the oldest message when the log is full.

func (*Panel) Status

func (p *Panel) Status(name, text string)

Status updates a named readout above the message log, creating its slot on first write. Later writes replace the text in place without changing its order. Empty text hides the line but keeps its slot, so it can reappear in the same position. Write changing readouts each frame; unchanged text remains visible until updated or cleared.

func (*Panel) StatusLines

func (p *Panel) StatusLines() []string

StatusLines returns the non-empty status lines in first-write order. The returned slice is independent of the panel's storage.

func (*Panel) Toggle

func (p *Panel) Toggle(b Builtin)

Toggle changes whether the overlay draws b. Undefined values have no effect.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL