Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrawScene ¶ added in v0.4.0
DrawScene composes a whole frame onto c — every cube, the grid chrome, the status line, the control hints and the move list. Drawing through the software canvas rather than the display means the same code paints a live window and a headless recording, pixel for pixel.
func Render ¶ added in v0.4.0
Render records a scripted run to cfg.Rec.Path without opening a window. It drives the same [gameState] the window drives, replaying cfg.Keys as if a player had pressed them, and composes frames with the same DrawScene — so the media matches what a player sees and needs no display.
The file extension picks the format: .gif or .mp4.
Types ¶
type Config ¶ added in v0.1.1
type Config struct {
Controller Controller
Link *Link
// Rec names the recording [Render] writes and Keys is the comma-separated
// keybind script it replays (e.g. "space", "shift+up", "plus,plus,tab").
// tools/demogen sets both; the window uses neither.
Rec record.Options
Keys string
}
type Controller ¶
type CubeView ¶ added in v0.4.0
type CubeView struct {
Facelets cube.Facelets
Label string
Status string
Short string
Turning bool
TurnMove cube.Move
TurnFrame int
Idx int
Moves []cube.Move
}
CubeView is one cube's drawable state.
type Link ¶ added in v0.1.0
Link is the window's channel pair to the multi-window hub. It aliases the engine's generic hub link specialised to Msg, so the leader and child wiring in internal/cli can hand the window a hub.Link[Msg] directly.
type SceneView ¶ added in v0.4.0
type SceneView struct {
Cubes []CubeView
Cols, Rows, W, H, Focus int
Yaw, Pitch, Zoom, Unfold float32
Xray, Manual, ShowMoves bool
Grid bool
Polys []render.Poly
}
SceneView is everything a frame draws, lifted out of the windowed game state so the composer needs nothing from the display.