{"id":13412945,"url":"https://github.com/faiface/pixel","last_synced_at":"2025-05-14T02:04:24.556Z","repository":{"id":37664586,"uuid":"74203833","full_name":"faiface/pixel","owner":"faiface","description":"A hand-crafted 2D game library in Go","archived":false,"fork":false,"pushed_at":"2024-05-23T19:26:29.000Z","size":12507,"stargazers_count":4494,"open_issues_count":45,"forks_count":246,"subscribers_count":100,"default_branch":"master","last_synced_at":"2025-04-13T00:37:44.118Z","etag":null,"topics":["game-engine","gamedev","gamedev-library","go","golang","graphics","library","window"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/faiface.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-19T11:15:34.000Z","updated_at":"2025-04-11T03:42:00.000Z","dependencies_parsed_at":"2022-07-10T03:18:19.521Z","dependency_job_id":"96631dd6-df4b-428c-949f-5368dc2937a4","html_url":"https://github.com/faiface/pixel","commit_stats":{"total_commits":903,"total_committers":49,"mean_commits":"18.428571428571427","dds":"0.33554817275747506","last_synced_commit":"d899a6bbed288cd1fb783b67a36266823e1d7ac1"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faiface%2Fpixel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faiface%2Fpixel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faiface%2Fpixel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faiface%2Fpixel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faiface","download_url":"https://codeload.github.com/faiface/pixel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052667,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game-engine","gamedev","gamedev-library","go","golang","graphics","library","window"],"created_at":"2024-07-30T20:01:31.446Z","updated_at":"2025-05-14T02:04:24.530Z","avatar_url":"https://github.com/faiface.png","language":"Go","funding_links":[],"categories":["Game Development","Go","Programming","\u003cspan id=\"游戏开发-game-development\"\u003e游戏开发 Game Development\u003c/span\u003e","遊戲開發","游戏开发","Repositories","Exercises and Games","Relational Databases","Libraries"],"sub_categories":["Search and Analytic Databases","Advanced Console UIs","Golang","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高級控制台界面","高级控制台界面","检索及分析资料库","SQL 查询语句构建库","Introductions and Tutorials","Go"],"readme":"# \\*\\*\\*\\*\\*NOTICE\\*\\*\\*\\*\\* \n\nThis repo is not under active development anymore and has been archived. Continued development has been migrated to [Pixel2](https://github.com/gopxl/pixel). A big thank you to [faiface](https://github.com/faiface) for creating this awesome library and for all the hard work put into it. We encourage old and new users to check out the new repo and contribute to it.\n\n\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"logo/LOGOTYPE-HORIZONTAL-BLUE.png\"\u003e\u003c/p\u003e\n\n# Pixel [![Build Status](https://travis-ci.org/faiface/pixel.svg?branch=master)](https://travis-ci.org/faiface/pixel) [![GoDoc](https://godoc.org/github.com/faiface/pixel?status.svg)](https://godoc.org/github.com/faiface/pixel) [![Go Report Card](https://goreportcard.com/badge/github.com/faiface/pixel)](https://goreportcard.com/report/github.com/faiface/pixel) [![Join the chat at https://gitter.im/pixellib/Lobby](https://badges.gitter.im/pixellib/Lobby.svg)](https://gitter.im/pixellib/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) [![Discord Chat](https://img.shields.io/discord/699679031603494954)](https://discord.gg/q2DK4MP)  \n\nA hand-crafted 2D game library in Go. Take a look into the [features](#features) to see what it can\ndo.\n\n```\ngo get github.com/faiface/pixel\n```\n\nIf you are using Modules (Go 1.11 or higher) and want a mutable copy of the source code:\n\n```\ngit clone https://github.com/faiface/pixel # clone outside of $GOPATH\ncd pixel\ngo install ./...\n```\n\nSee [requirements](#requirements) for the list of libraries necessary for compilation.\n\nAll significant changes are documented in [CHANGELOG.md](CHANGELOG.md).\n\n## Tutorial\n\nThe [Wiki of this repo](https://github.com/faiface/pixel/wiki) contains an extensive tutorial\ncovering several topics of Pixel. Here's the content of the tutorial parts so far:\n\n- [Creating a Window](https://github.com/faiface/pixel/wiki/Creating-a-Window)\n- [Drawing a Sprite](https://github.com/faiface/pixel/wiki/Drawing-a-Sprite)\n- [Moving, scaling and rotating with Matrix](https://github.com/faiface/pixel/wiki/Moving,-scaling-and-rotating-with-Matrix)\n- [Pressing keys and clicking mouse](https://github.com/faiface/pixel/wiki/Pressing-keys-and-clicking-mouse)\n- [Drawing efficiently with Batch](https://github.com/faiface/pixel/wiki/Drawing-efficiently-with-Batch)\n- [Drawing shapes with IMDraw](https://github.com/faiface/pixel/wiki/Drawing-shapes-with-IMDraw)\n- [Typing text on the screen](https://github.com/faiface/pixel/wiki/Typing-text-on-the-screen)\n- [Using a custom fragment shader](https://github.com/faiface/pixel/wiki/Using-a-custom-fragment-shader)\n\n## [Examples](https://github.com/faiface/pixel-examples)\n\nThe [examples](https://github.com/faiface/pixel-examples) repository contains a few\nexamples demonstrating Pixel's functionality.\n\n**To run an example**, navigate to it's directory, then `go run` the `main.go` file. For example:\n\n```\n$ cd pixel-examples/platformer\n$ go run main.go\n```\n\nHere are some screenshots from the examples!\n\n| [Lights](https://github.com/faiface/pixel-examples/blob/master/lights) | [Platformer](https://github.com/faiface/pixel-examples/blob/master/platformer) |\n| --- | --- |\n| ![Lights](https://github.com/faiface/pixel-examples/blob/master/lights/screenshot.png) | ![Platformer](https://github.com/faiface/pixel-examples/blob/master/platformer/screenshot.png) |\n\n| [Smoke](https://github.com/faiface/pixel-examples/blob/master/smoke) | [Typewriter](https://github.com/faiface/pixel-examples/blob/master/typewriter) |\n| --- | --- |\n| ![Smoke](https://github.com/faiface/pixel-examples/blob/master/smoke/screenshot.png) | ![Typewriter](https://github.com/faiface/pixel-examples/blob/master/typewriter/screenshot.png) |\n\n| [Raycaster](https://github.com/faiface/pixel-examples/blob/master/community/raycaster) | [Gizmo](https://github.com/Lallassu/gizmo) |\n| --- | --- |\n| ![Raycaster](https://github.com/faiface/pixel-examples/blob/master/community/raycaster/screenshot.png) | ![Gizmo](https://github.com/Lallassu/gizmo/blob/master/preview.png) |\n\n## Features\n\nHere's the list of the main features in Pixel. Although Pixel is still under heavy development,\n**there should be no major breakage in the API.** This is not a 100% guarantee, though.\n\n- Fast 2D graphics\n  - Sprites\n  - Primitive shapes with immediate mode style\n    [IMDraw](https://github.com/faiface/pixel/wiki/Drawing-shapes-with-IMDraw) (circles, rectangles,\n    lines, ...)\n  - Optimized drawing with [Batch](https://github.com/faiface/pixel/wiki/Drawing-efficiently-with-Batch)\n  - Text drawing with [text](https://godoc.org/github.com/faiface/pixel/text) package\n- Audio through a separate [Beep](https://github.com/faiface/beep) library.\n- Simple and convenient API\n  - Drawing a sprite to a window is as simple as `sprite.Draw(window, matrix)`\n  - Wanna know where the center of a window is? `window.Bounds().Center()`\n  - [...](https://godoc.org/github.com/faiface/pixel)\n- Full documentation and tutorial\n- Works on Linux, macOS and Windows\n- Window creation and manipulation (resizing, fullscreen, multiple windows, ...)\n- Keyboard (key presses, text input) and mouse input without events\n- Well integrated with the Go standard library\n  - Use `\"image\"` package for loading pictures\n  - Use `\"time\"` package for measuring delta time and FPS\n  - Use `\"image/color\"` for colors, or use Pixel's own `color.Color` format, which supports easy\n    multiplication and a few more features\n  - Pixel uses `float64` throughout the library, compatible with `\"math\"` package\n- Geometry transformations with\n  [Matrix](https://github.com/faiface/pixel/wiki/Moving,-scaling-and-rotating-with-Matrix)\n  - Moving, scaling, rotating\n  - Easy camera implementation\n- Off-screen drawing to Canvas or any other target (Batch, IMDraw, ...)\n- Fully garbage collected, no `Close` or `Dispose` methods\n- Full [Porter-Duff](http://ssp.impulsetrain.com/porterduff.html) composition, which enables\n  - 2D lighting\n  - Cutting holes into objects\n  - Much more...\n- Pixel let's you draw stuff and do your job, it doesn't impose any particular style or paradigm\n- Platform and backend independent [core](https://godoc.org/github.com/faiface/pixel)\n- Core Target/Triangles/Picture pattern makes it easy to create new drawing targets that do\n  arbitrarily crazy stuff (e.g. graphical effects)\n- Small codebase, ~5K lines of code, including the backend [glhf](https://github.com/faiface/glhf)\n  package\n\n ## Related repositories\n\n Here are some packages which use Pixel:\n - [TilePix](https://github.com/bcvery1/tilepix) Makes handling TMX files built with [Tiled](https://www.mapeditor.org/) trivially easy to work with using Pixel.\n - [spriteplus](https://github.com/cebarks/spriteplus) Basic `SpriteSheet` and `Animation` implementations\n - [PixelUI](https://github.com/dusk125/pixelui) Imgui-based GUIs for Pixel\n - [pixelutils](https://github.com/dusk125/pixelutils) Variety of game related utilities (sprite packer, id generator, ticker, sprite loader, voronoia diagrams)\n\n## Missing features\n\nPixel is in development and still missing few critical features. Here're the most critical ones.\n\n- ~~Audio~~\n- ~~Drawing text~~\n- Antialiasing (filtering is supported, though)\n- ~~Advanced window manipulation (cursor hiding, window icon, ...)~~\n- Better support for Hi-DPI displays\n- Mobile (and perhaps HTML5?) backend\n- ~~More advanced graphical effects (e.g. blur)~~ (solved with the addition of GLSL effects)\n- Tests and benchmarks\n- Vulkan support\n\n**Implementing these features will get us to the 1.0 release.** Contribute, so that it's as soon as\npossible!\n\n## Requirements\n\nIf you're using Windows and having trouble building Pixel, please check [this\nguide](https://github.com/faiface/pixel/wiki/Building-Pixel-on-Windows) on the\n[wiki](https://github.com/faiface/pixel/wiki).\n\n[PixelGL](https://godoc.org/github.com/faiface/pixel/pixelgl) backend uses OpenGL to render\ngraphics. Because of that, OpenGL development libraries are needed for compilation. The dependencies\nare same as for [GLFW](https://github.com/go-gl/glfw).\n\nThe OpenGL version used is **OpenGL 3.3**.\n\n- On macOS, you need Xcode or Command Line Tools for Xcode (`xcode-select --install`) for required\n  headers and libraries.\n- On Ubuntu/Debian-like Linux distributions, you need `libgl1-mesa-dev` and `xorg-dev` packages.\n- On CentOS/Fedora-like Linux distributions, you need `libX11-devel libXcursor-devel libXrandr-devel\n  libXinerama-devel mesa-libGL-devel libXi-devel libXxf86vm-devel` packages.\n- See [here](http://www.glfw.org/docs/latest/compile.html#compile_deps) for full details.\n\n**The combination of Go 1.8, macOS and latest XCode seems to be problematic** as mentioned in issue\n[#7](https://github.com/faiface/pixel/issues/7). This issue is probably not related to Pixel.\n**Upgrading to Go 1.8.1 fixes the issue.**\n\n## Contributing\n\nJoin us in the [Discord Chat!](https://discord.gg/q2DK4MP)\n\nPixel is in, let's say, mid-stage of development. Many of the important features are here, some are\nmissing. That's why **contributions are very important and welcome!** All alone, I will be able to\nfinish the library, but it'll take a lot of time. With your help, it'll take much less. I encourage\neveryone to contribute, even with just an idea. Especially welcome are **issues** and **pull\nrequests**.\n\n**However, I won't accept everything. Pixel is being developed with thought and care.** Each\ncomponent was designed and re-designed multiple times. Code and API quality is very important here.\nAPI is focused on simplicity and expressiveness.\n\nWhen contributing, keep these goals in mind. It doesn't mean that I'll only accept perfect pull\nrequests. It just means that I might not like your idea. Or that your pull requests could need some\nrewriting. That's perfectly fine, don't let it put you off. In the end, we'll just end up with a\nbetter result.\n\nTake a look at [CONTRIBUTING.md](CONTRIBUTING.md) for further information.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaiface%2Fpixel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaiface%2Fpixel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaiface%2Fpixel/lists"}