{"id":29116529,"url":"https://github.com/gopxl/pixel","last_synced_at":"2026-01-12T04:50:54.979Z","repository":{"id":198768343,"uuid":"701492085","full_name":"gopxl/pixel","owner":"gopxl","description":"A hand-crafted 2D game library in Go.","archived":false,"fork":false,"pushed_at":"2025-03-07T21:25:40.000Z","size":52199,"stargazers_count":331,"open_issues_count":33,"forks_count":12,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-06-29T11:13:58.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mewbak/pixel2","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gopxl.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2023-10-06T18:50:53.000Z","updated_at":"2025-06-24T13:03:28.000Z","dependencies_parsed_at":"2023-10-27T15:34:19.813Z","dependency_job_id":"aac36d17-cd41-4a88-8582-d4f32dfe5094","html_url":"https://github.com/gopxl/pixel","commit_stats":null,"previous_names":["gopxl/pixel2","gopxl/pixel"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/gopxl/pixel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopxl%2Fpixel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopxl%2Fpixel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopxl%2Fpixel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopxl%2Fpixel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gopxl","download_url":"https://codeload.github.com/gopxl/pixel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopxl%2Fpixel/sbom","scorecard":{"id":441402,"data":{"date":"2025-08-11","repo":{"name":"github.com/gopxl/pixel","commit":"61f9c42d3c4aa118e39f5a720962db19f45bbf4d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/gopxl/pixel/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/gopxl/pixel/go.yml/main?enable=pin","Warn: goCommand not pinned by hash: .github/workflows/go.yml:27","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T05:39:31.668Z","repository_id":198768343,"created_at":"2025-08-19T05:39:31.668Z","updated_at":"2025-08-19T05:39:31.668Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28334844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-06-29T11:13:40.082Z","updated_at":"2026-01-12T04:50:54.963Z","avatar_url":"https://github.com/gopxl.png","language":"Go","funding_links":[],"categories":["Game Development","游戏开发"],"sub_categories":["Search and Analytic Databases","检索及分析资料库"],"readme":"# __**Important Notice **__\nRevived fork of the original [Pixel](https://github.com/faiface/pixel) library by [faiface](https://github.com/faiface). This fork is intended to be a community-driven effort to continue the development of the library. We were unable to get a hold of the original author, to take ownership of the original repository to carry on the legacy of the wonderful work. If you are interested in contributing, please join us in the [Discord Chat!](https://discord.gg/n2Y8uVneK6)\n\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"logo/LOGOTYPE-HORIZONTAL-BLUE2.png\"\u003e\u003c/p\u003e\n\n\n# Pixel 2\n[![Go Reference](https://pkg.go.dev/badge/github.com/gopxl/pixel/v2.svg)](https://pkg.go.dev/github.com/gopxl/pixel/v2)\n[![Go build status](https://github.com/gopxl/pixel/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/gopxl/pixel/actions/workflows/go.yml?query=branch%3Amain)\n[![Coverage Status](https://coveralls.io/repos/github/gopxl/pixel/badge.svg?branch=main)](https://coveralls.io/github/gopxl/pixel?branch=main)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gopxl/pixel/v2)](https://goreportcard.com/report/github.com/gopxl/pixel/v2) \n[![Discord Chat](https://img.shields.io/discord/1158461233121468496)](https://discord.gg/hPBTTXGDU3)  \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/gopxl/pixel/v2\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/gopxl/pixel # clone outside of $GOPATH\ncd pixel\ngo install ./...\n```\n\nSee [requirements](#requirements) for the list of libraries necessary for compilation.\n\n## Tutorial\n\nThe [Wiki of this repo](./docs/README.md) contains an extensive tutorial\ncovering several topics of Pixel. \n\nFor the tutorial walking through the basics of Pixel, check out [The Basics](./docs/Basics/Creating-a-Window.md)!\n\n## [Examples](https://github.com/gopxl/pixel-examples)\n\nThe [examples](https://github.com/gopxl/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/gopxl/pixel-examples/blob/main/lights) | [Platformer](https://github.com/gopxl/pixel-examples/blob/main/platformer) |\n| --- | --- |\n| ![Lights](https://github.com/gopxl/pixel-examples/blob/main/lights/screenshot.png) | ![Platformer](https://github.com/gopxl/pixel-examples/blob/main/platformer/screenshot.png) |\n\n| [Smoke](https://github.com/gopxl/pixel-examples/blob/main/smoke) | [Typewriter](https://github.com/gopxl/pixel-examples/blob/main/typewriter) |\n| --- | --- |\n| ![Smoke](https://github.com/gopxl/pixel-examples/blob/main/smoke/screenshot.png) | ![Typewriter](https://github.com/gopxl/pixel-examples/blob/main/typewriter/screenshot.png) |\n\n| [Raycaster](https://github.com/gopxl/pixel-examples/blob/main/community/raycaster) | [Gizmo](https://github.com/Lallassu/gizmo) |\n| --- | --- |\n| ![Raycaster](https://github.com/gopxl/pixel-examples/blob/main/community/raycaster/screenshot.png) | ![Gizmo](https://github.com/Lallassu/gizmo/blob/master/preview.png) |\n\n## Release Schedule\nWe aim to release a new version the 1st of every month.\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](./docs/Basics/Drawing-shapes-with-IMDraw.md) (circles, rectangles,\n    lines, ...)\n  - Optimized drawing with [Batch](./docs/Basics/Drawing-efficiently-with-Batch.md)\n  - Text drawing with [text](https://godoc.org/github.com/gopxl/pixel/v2/text) package\n- Audio through a separate [Beep](https://github.com/gopxl/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/gopxl/pixel/v2)\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](./docs/Basics/Moving,-scaling-and-rotating-with-Matrix.md)\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/gopxl/pixel/v2)\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/gopxl/glhf/v2)\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 guide](./docs/Compilation/Building-Pixel-on-Windows.md) on the [wiki](./docs/README.md).\n\nOpenGL 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- On Linux to use Wayland instead of X11, compile your project with `-tags wayland`.\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/gopxl/pixel/v2/issues/7). This issue is probably not related to Pixel.\n**Upgrading to Go 1.8.1 fixes the issue.**\n\n### Windows Subsystem for Linux\n\nWhile pixel does run on Windows, you will likely have significantly better performance running in WSL2, which now has support for GUI applications built-in with WSLg.\n\nInstallation instructions [here](https://github.com/microsoft/wslg?tab=readme-ov-file#installing-wslg). If you already have an old version of WSL installed, \nmake sure to follow the upgrade instructions to get WSL2 as well as update your distribution of choice to version 2. Additionally, if you have an old `DISPLAY` environment variable set in your ~/.bashrc (or equivalent) for WSL1, you should remove it. This is now configured automatically.\n\nOnce WSL is setup, follow the usual Go and OpenGL installation instructions for your chosen distribution of linux.\n\nFinally, add `export LIBGL_ALWAYS_INDIRECT=0` to your ~/.bashrc (or equivalent) if you see an error like `Error: creating window failed: VersionUnavailable: GLX: Failed to create context: GLXBadFBConfig` when attempting to launch an OpenGL application from WSL.\n\n## Cross Platform Build\n\nGo supports cross platform build targets natively, but because pixel depends on [CGo](https://pkg.go.dev/cmd/cgo) it is necessary to specify a C cross-compiler that is compatible with the target.\n\n### Linux to Windows\n\nTo build a windows executable on linux, you will need to install a windows C compiler, such as mingw. The following commands can be used to build for an amd64 architecture on windows.\n\nInstall mingw on linux with apt:\n```sh\nsudo apt update\nsudo apt install gcc-mingw-w64\n```\n\nBuild for windows amd64\n```sh\nGOOS=windows GOARCH=amd64 CGO_ENABLED=1 CXX=x86_64-w64-mingw32-g++ CC=x86_64-w64-mingw32-gcc go build\n```\n\n## Contributing\n\nJoin us in the [Discord Chat!](https://discord.gg/n2Y8uVneK6)\n\nPixel is currently in a developmental phase, with many of its key features already in place, while others are still in the works. \nWe genuinely appreciate and value contributions, as they can significantly expedite the development process. I invite everyone to \ncontribute in any way they can, even if it's just sharing an idea. We especially value the submission of issues and pull requests.\n\nThat said, it's **important to remember that Pixel is being developed with a great deal of thought and attention to detail**. Each component \nhas gone through numerous design iterations to ensure quality. We place a high premium on code and API quality, with an emphasis on simplicity and expressiveness.\nWhen contributing, please bear these goals in mind. This doesn't mean that only flawless pull requests will be accepted. Rather, it \nmeans that there may be times when a proposal might not align with our vision, or when a pull request might require some revisions. \nThis is completely normal and should not discourage you. After all, our shared goal is to achieve the best end result possible.\n\nTake a look at [CONTRIBUTING.md](CONTRIBUTING.md) for further information.\n\n## License\n\n[MIT](LICENSE)\n\n## Special Contributions\n\n- A significant shoutout to the original author [faiface](https://github.com/faiface) for starting and growing the Pixel community. We would not be here if not for him.\n- The active/inactive maintainers of the original Pixel repo:\n    - [dusk125](https://github.com/dusk125)\n    - [cebarks](https://github.com/cebarks)\n    - [Benjyclay](https://github.com/Benjyclay)\n    - [delp](https://github.com/delp)\n    - [roipoussiere](https://github.com/roipoussiere)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopxl%2Fpixel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgopxl%2Fpixel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopxl%2Fpixel/lists"}