telemetry

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 14 Imported by: 1 module, 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 telemetry is the panel in the top-left corner saying how the game runs: the frame rate, the ticks a second, where a frame's time goes, the entities, the game time, and whatever the plugins and the game add. It is a scene of its own in every Stage with a world, hidden until ~ (the players' key) or the Stage's Shows shows it.

Plugin

NewPlugin makes the panel over a world with the standard lines; a Stage built with game/stage makes one itself where the game made none (Of finds it). Plugin.With adds the lines of render.Reporters (the atmosphere's, collision's stats), Plugin.Line a line of the game's own, Plugin.Clear drops every line, the standard ones too; all before the Stage's scenes are made. A value of several lines stands under its label, a part a line. The lines are read after the ticks while the panel is shown, four times a second and as the mode changes; the panel draws the last reading. Write.Show, Write.Hide, Write.Toggle and Read.Shown work on the Stage's Composition, as the players' key does.

Mode

The panel shows the basics (Basic: the frame rate, the ticks a second, where a frame's time goes and the entities) or every line (Extended: the game time, the reporters' and the game's own too); Write.SetMode and Read.Mode set and read it, Settings keeps it with the game.

Vocabulary

Commands: Panel (a player's, carried by the players: it needs the scene's Composition). Settings (Settings, in Resources): the panel showing every line.

Index

Constants

View Source
const SceneName = "gram.telemetry"

SceneName is the name of the panel's scene in a Stage's stack.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode int

Mode is what the panel shows: the basics, the frame rate, the ticks a second, where a frame's time goes and the entities, or every line.

const (
	Basic Mode = iota
	Extended
)

type Panel

type Panel struct {
	Shown    bool
	Extended bool
}

Panel shows the telemetry panel, or hides it, the basics or everything (Mode): ~ among the players' GameBindings, which carry it out, turns it from hidden to the basics, to everything and to hidden again.

func (Panel) Command

func (Panel) Command()

type Plugin

type Plugin struct {
	*world.Self

	Res Resources
	// contains filtered or unexported fields
}

Plugin is the telemetry panel: its lines, and the scene that draws them top-left.

func NewPlugin

func NewPlugin(worldPlugin *world.Plugin) *Plugin

NewPlugin makes the panel over worldPlugin's world with the standard lines: the basics, the frame rate, the ticks a second, where a frame's time goes and the entities, and the game time.

func Of

func Of(worldPlugin *world.Plugin) *Plugin

Of is the telemetry plugin made over worldPlugin, nil where none was.

func (*Plugin) Clear

func (p *Plugin) Clear() *Plugin

Clear drops every line, the standard ones too, for a game starting from nothing; before the Stage's scenes are made.

func (*Plugin) EventHandler

func (p *Plugin) EventHandler() control.EventHandler

EventHandler is nil: the players' key shows and hides the panel.

func (*Plugin) Install

func (p *Plugin) Install(ctx plugin.Installer) error

Install reads the engine's tick counter where the Installer has one.

func (*Plugin) Line

func (p *Plugin) Line(label string, value func() string) *Plugin

Line adds a line of the game's own, label: value, value read four times a second, shown in the Extended mode; a value of several lines stands under its label, each indented. Before the Stage's scenes are made.

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Read added in v0.4.0

func (p *Plugin) Read(int) *Read

Read reads the telemetry panel's state on worker w of the game's pool, 0 the game's own goroutine.

func (*Plugin) Restore

func (p *Plugin) Restore()

Restore takes the Settings loaded.

func (*Plugin) RunPlan

func (p *Plugin) RunPlan(goke.RunCtx, time.Duration)

func (*Plugin) Scenes

func (p *Plugin) Scenes() []game.Scene

Scenes is the panel's one scene (game.Scenic), hidden until shown.

func (*Plugin) Serializable

func (p *Plugin) Serializable() plugin.Serializable

Serializable is the panel's Settings, kept whole; whether it is shown is the Composition's.

func (*Plugin) With

func (p *Plugin) With(reporters ...render.Reporter) *Plugin

With adds the lines of reporters, in order, under the lines so far, shown in the Extended mode; before the Stage's scenes are made.

func (*Plugin) Write added in v0.4.0

func (p *Plugin) Write() *Write

Write changes the telemetry panel's state, on the game's goroutine.

type Read added in v0.4.0

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

Read reads the telemetry panel's state, the same on every goroutine.

func (*Read) Mode added in v0.4.0

func (r *Read) Mode() Mode

Mode is what the panel shows.

func (*Read) Shown added in v0.4.0

func (r *Read) Shown(c game.Composition) bool

Shown says whether the panel is shown.

type Resources

type Resources struct {
	Settings Settings
}

Resources is what the panel publishes: its Settings.

type Settings

type Settings struct {
	Extended bool
}

Settings is what the panel keeps of its own, saved with the game: whether it shows every line or the basics alone.

type Write added in v0.4.0

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

Write changes the telemetry panel's state, on the game's goroutine.

func (*Write) Hide added in v0.4.0

func (w *Write) Hide(c game.Composition)

Hide hides the panel.

func (*Write) SetMode added in v0.4.0

func (w *Write) SetMode(m Mode)

SetMode has the panel show the basics or every line (Settings.Extended).

func (*Write) Show added in v0.4.0

func (w *Write) Show(c game.Composition)

Show shows the panel on top of the scenes shown.

func (*Write) Toggle added in v0.4.0

func (w *Write) Toggle(c game.Composition)

Toggle shows the panel, or hides it when shown.

Jump to

Keyboard shortcuts

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