Versions in this module Expand all Collapse all v1 v1.2.1 Aug 16, 2026 Changes in this version + const ErrInvalidScreenDimensions + const ErrNilSketch + const ErrSketchAlreadyRunning + const Termination + func CursorPosition() vector.Vector + func FPS() float64 + func Fullscreen(enable bool) + func IsFullscreen() bool + func IsKeyPressed(k Key) bool + func IsMouseButtonPressed(k Key) bool + func MonitorSize() vector.Vector + func Run(screenWidth, screenHeight int, sketch Sketchable, opts ...Option) error + func Scroll() (dx, dy float64) + func TPS() float64 + type DrawOptions struct + Anchor vector.Vector + Opacity float64 + Pos vector.Vector + Rotation float64 + Scale vector.Vector + Tint color.Color + func DefaultDrawOptions() DrawOptions + type Environment struct + func (e *Environment) DeltaTime() time.Duration + func (e *Environment) ScreenSize() vector.Vector + type Image struct + func ImageFromFS(fs fs.FS, path string) (*Image, error) + func ImageFromFile(path string) (*Image, error) + func ImageFromStdImage(src image.Image) *Image + func NewBlackImage(dim vector.Vector) *Image + func NewBlankImage(dim vector.Vector) *Image + func NewFilledImage(dim vector.Vector, c color.Color) *Image + func NewWhiteImage(dim vector.Vector) *Image + func (i *Image) Arc(v vector.Vector, radius, startAngle, endAngle, strokeWidth float64, ...) + func (i *Image) At(v vector.Vector) color.Color + func (i *Image) Circle(v vector.Vector, radius, strokeWidth float64, c color.Color) + func (i *Image) Clear() + func (i *Image) Clone() *Image + func (i *Image) CopyTo(dst *Image, srcPos, size, dstPos vector.Vector) + func (i *Image) Draw(dst *Image, opts *DrawOptions) + func (i *Image) DrawAt(dst *Image, pos vector.Vector) + func (i *Image) Fill(c color.Color) + func (i *Image) FillArc(v vector.Vector, radius, startAngle, endAngle float64, c color.Color) + func (i *Image) FillCircle(v vector.Vector, radius, strokeWidth float64, c color.Color) + func (i *Image) FillRectangle(v vector.Vector, width, height, strokeWidth float64, c color.Color) + func (i *Image) FillShape(points []vector.Vector, close bool, c color.Color) + func (i *Image) Height() float64 + func (i *Image) Line(v1, v2 vector.Vector, strokeWidth float64, c color.Color) + func (i *Image) Rectangle(v vector.Vector, width, height, strokeWidth float64, c color.Color) + func (i *Image) Set(v vector.Vector, c color.Color) + func (i *Image) Shape(points []vector.Vector, close bool, strokeWidth float64, c color.Color) + func (i *Image) Size() vector.Vector + func (i *Image) SubImage(pos, size vector.Vector) *Image + func (i *Image) Width() float64 + type Key int + const KeyA + const KeyAlt + const KeyAltLeft + const KeyAltRight + const KeyArrowDown + const KeyArrowLeft + const KeyArrowRight + const KeyArrowUp + const KeyB + const KeyBackquote + const KeyBackslash + const KeyBackspace + const KeyBracketLeft + const KeyBracketRight + const KeyC + const KeyCapsLock + const KeyComma + const KeyContextMenu + const KeyControl + const KeyControlLeft + const KeyControlRight + const KeyD + const KeyDelete + const KeyDigit0 + const KeyDigit1 + const KeyDigit2 + const KeyDigit3 + const KeyDigit4 + const KeyDigit5 + const KeyDigit6 + const KeyDigit7 + const KeyDigit8 + const KeyDigit9 + const KeyE + const KeyEnd + const KeyEnter + const KeyEqual + const KeyEscape + const KeyF + const KeyF1 + const KeyF10 + const KeyF11 + const KeyF12 + const KeyF13 + const KeyF14 + const KeyF15 + const KeyF16 + const KeyF17 + const KeyF18 + const KeyF19 + const KeyF2 + const KeyF20 + const KeyF21 + const KeyF22 + const KeyF23 + const KeyF24 + const KeyF3 + const KeyF4 + const KeyF5 + const KeyF6 + const KeyF7 + const KeyF8 + const KeyF9 + const KeyG + const KeyH + const KeyHome + const KeyI + const KeyInsert + const KeyIntlBackslash + const KeyJ + const KeyK + const KeyL + const KeyM + const KeyMetaLeft + const KeyMetaRight + const KeyMinus + const KeyN + const KeyNumLock + const KeyNumpad0 + const KeyNumpad1 + const KeyNumpad2 + const KeyNumpad3 + const KeyNumpad4 + const KeyNumpad5 + const KeyNumpad6 + const KeyNumpad7 + const KeyNumpad8 + const KeyNumpad9 + const KeyNumpadAdd + const KeyNumpadDecimal + const KeyNumpadDivide + const KeyNumpadEnter + const KeyNumpadEqual + const KeyNumpadMultiply + const KeyNumpadSubtract + const KeyO + const KeyP + const KeyPageDown + const KeyPageUp + const KeyPause + const KeyPeriod + const KeyPrintScreen + const KeyQ + const KeyQuote + const KeyR + const KeyS + const KeyScrollLock + const KeySemicolon + const KeyShift + const KeyShiftLeft + const KeyShiftRight + const KeySlash + const KeySpace + const KeyT + const KeyTab + const KeyU + const KeyV + const KeyW + const KeyX + const KeyY + const KeyZ + type MouseButton int + const MouseButton0 + const MouseButton1 + const MouseButton2 + const MouseButton3 + const MouseButton4 + const MouseButtonLeft + const MouseButtonMiddle + const MouseButtonRight + type Option func(sketchBuildParams) + func WithAntyaliasing(enable bool) Option + func WithBackgroundColor(c color.Color) Option + func WithResizing(enable bool) Option + func WithRunnableOnUnfocused(enable bool) Option + func WithTerminationKeys(k ...Key) Option + func WithWindowTitle(title string) Option + type Scene struct + func (s *Scene) Arc(v vector.Vector, radius, startAngle, endAngle, strokeWidth float64, ...) + func (s *Scene) At(v vector.Vector) color.Color + func (s *Scene) Circle(v vector.Vector, radius, strokeWidth float64, c color.Color) + func (s *Scene) Clear() + func (s *Scene) DrawImage(img *Image, pos, size vector.Vector) + func (s *Scene) Fill(c color.Color) + func (s *Scene) FillArc(v vector.Vector, radius, startAngle, endAngle float64, c color.Color) + func (s *Scene) FillCircle(v vector.Vector, radius, strokeWidth float64, c color.Color) + func (s *Scene) FillRectangle(v vector.Vector, width, height, strokeWidth float64, c color.Color) + func (s *Scene) FillShape(points []vector.Vector, close bool, c color.Color) + func (s *Scene) Height() float64 + func (s *Scene) Line(v1, v2 vector.Vector, strokeWidth float64, c color.Color) + func (s *Scene) Pull() + func (s *Scene) Push() + func (s *Scene) Rectangle(v vector.Vector, width, height, strokeWidth float64, c color.Color) + func (s *Scene) Rotate(angle float64) + func (s *Scene) Scale(rate float64) + func (s *Scene) ScaleX(rate float64) + func (s *Scene) ScaleY(rate float64) + func (s *Scene) Shape(points []vector.Vector, close bool, strokeWidth float64, c color.Color) + func (s *Scene) Size() vector.Vector + func (s *Scene) Transform(v vector.Vector) + func (s *Scene) TransformX(dx float64) + func (s *Scene) TransformY(dy float64) + func (s *Scene) Width() float64 + type Sketch struct + func (s *Sketch) Draw(scene *Scene) + func (s *Sketch) Setup(env *Environment) error + func (s *Sketch) Update(env *Environment) error + type Sketchable interface + Draw func(*Scene) + Setup func(env *Environment) error + Update func(*Environment) error