Build a 2D game or interactive demo in Go using sprites, shapes, and a game loop.
Add keyboard and mouse input handling to a Go graphics application.
Render many objects efficiently using batch drawing for performance-sensitive 2D scenes.
Implement a scrolling camera in a 2D Go game using the Matrix transform type.
Requires OpenGL development libraries installed on your system before the Go package will compile.
Pixel is a 2D game library for the Go programming language. It gives developers the building blocks to create windows, draw sprites and shapes, handle keyboard and mouse input, and render text on screen, all without reaching for a heavy game engine. The library was designed to feel like a natural extension of Go's standard library rather than an isolated system with its own rules. Note: this repository has been archived and is no longer actively developed. Continued development has moved to a new project called Pixel2 at github.com/gopxl/pixel. New users are encouraged to go there instead. The original library supports sprites, primitive shapes like circles, rectangles, and lines, optimized batch drawing for rendering many objects at once, and text rendering. It works on Linux, macOS, and Windows. Audio is handled through a companion library called Beep rather than being built in. Geometry operations like moving, scaling, and rotating objects are done through a Matrix type, which also makes it straightforward to implement a scrolling camera. The API was designed to be concise. Drawing a sprite to the window takes one line of code. The library also integrates with Go's standard packages: you use the built-in image package to load pictures, the time package for frame timing, and the standard color types alongside Pixel's own color format. A wiki on the repository contains a multi-part tutorial covering window creation, drawing sprites, handling input, batch drawing, drawing shapes, text, and custom shaders. A separate examples repository shows working demos including a platformer, a lighting effect, a smoke simulation, and a raycaster. The library's core is about 5,000 lines of code and uses OpenGL for rendering, which means OpenGL development libraries must be installed before compiling.
← faiface on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.