record

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package record captures gameplay frames and writes an animated GIF. It exists so any Collider game can produce a shareable clip with zero tooling: set COLLIDER_RECORD=demo.gif, play, close the window.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recorder

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

Recorder accumulates downscaled palettized frames and encodes them on Save. All methods run on the game loop; nothing is concurrent.

func New

func New(path string, w, h int) *Recorder

func (*Recorder) Add

func (r *Recorder) Add(pix []byte)

Add consumes one full-resolution RGBA frame (4 bytes per pixel).

func (*Recorder) Save

func (r *Recorder) Save()

Save encodes the captured frames as an animated GIF.

func (*Recorder) ShouldCapture

func (r *Recorder) ShouldCapture() bool

ShouldCapture throttles capture to the GIF frame rate regardless of the display's refresh rate.

Jump to

Keyboard shortcuts

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