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
- type Mode
- type Panel
- type Plugin
- func (p *Plugin) Clear() *Plugin
- func (p *Plugin) EventHandler() control.EventHandler
- func (p *Plugin) Install(ctx plugin.Installer) error
- func (p *Plugin) Line(label string, value func() string) *Plugin
- func (p *Plugin) Name() string
- func (p *Plugin) Read(int) *Read
- func (p *Plugin) Restore()
- func (p *Plugin) RunPlan(goke.RunCtx, time.Duration)
- func (p *Plugin) Scenes() []game.Scene
- func (p *Plugin) Serializable() plugin.Serializable
- func (p *Plugin) With(reporters ...render.Reporter) *Plugin
- func (p *Plugin) Write() *Write
- type Read
- type Resources
- type Settings
- type Write
Constants ¶
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.
type Panel ¶
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.
type Plugin ¶
Plugin is the telemetry panel: its lines, and the scene that draws them top-left.
func NewPlugin ¶
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 (*Plugin) Clear ¶
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) Line ¶
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) Read ¶ added in v0.4.0
Read reads the telemetry panel's state on worker w of the game's pool, 0 the game's own goroutine.
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.
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.
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) SetMode ¶ added in v0.4.0
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.