Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Background = color.RGBA{R: 18, G: 20, B: 26, A: 255}
Background is the colour behind every frame. The caller clears with it, since how you clear differs between a live window and a pixel buffer.
Functions ¶
func DrawFrame ¶ added in v0.4.0
func DrawFrame(r core.Renderer, cfg Config, st FrameState)
DrawFrame composes one frame — the world, the sensor rays, the HUD, the keymap and the fitness sparkline — through r. It draws only through core.Renderer, so the same code composes a live window frame and a headless one for documentation media. The caller clears to Background first.
func Render ¶ added in v0.4.0
Render records a run to cfg.Rec.Path without opening a window, drawing every frame through the software renderer. It composes frames with the same DrawFrame the window uses, so the media matches what a player sees, and it needs no display — a docs build can run it anywhere.
The file extension picks the format: .gif or .mp4.
Types ¶
type Config ¶
type Config struct {
Title string
Keymap []keymap.Binding
Population bool
Step func() bool
Complete func()
Next func()
Render func(core.Renderer)
HUD func() []string
Series func() []float64
Bounds func() (minX, minY, maxX, maxY float64, ok bool)
Leader func() (x, y float64, ok bool)
Sensors func() (origin core.Vec2, ends []core.Vec2, ok bool)
Save func() error
Load func() error
Regenerate func(seed int64)
// Rec names the recording [Render] writes; it is set by tools/demogen.
Rec record.Options
}