Go to file
Michal Štrba 1e2eb29a4f Merge pull request #2 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2017-04-24 14:20:12 +02:00
examples minor change in platformer example readme 2017-04-22 16:17:33 +02:00
imdraw remove commented code 2017-04-21 16:43:56 +02:00
pixelgl temporarily fix issue #1 2017-04-22 13:15:57 +02:00
.gitignore add gitignore 2016-12-16 19:32:56 +01:00
LICENSE Initial commit 2016-11-19 12:15:34 +01:00
README.md Add Gitter badge 2017-04-24 12:18:51 +00:00
batch.go minor change 2017-04-15 21:03:22 +02:00
color.go fix typo in Alpha doc 2017-04-15 18:04:03 +02:00
compose.go fix type in ComposeMethod doc 2017-04-11 17:28:27 +02:00
data.go adopt RGB and Alpha 2017-04-10 17:25:56 +02:00
doc.go minor change in pixel package doc 2017-04-21 17:01:46 +02:00
drawer.go fix grammar in Drawer doc 2017-04-13 15:15:17 +02:00
geometry.go simplify code in Rect.Resized 2017-04-13 15:26:48 +02:00
interface.go move ComposeTarget to separate file 2017-04-11 16:45:56 +02:00
sprite.go minor optimization in Sprite 2017-04-12 16:18:25 +02:00

README.md

Pixel GoDoc Go Report Card

Join the chat at https://gitter.im/pixellib/Lobby

A 2D game library that doesn't get in your way. Focus on ease of use, extensibility and performance. Take a look into the features to see what it can do.

go get github.com/faiface/pixel

See requirements for the list of libraries necessary for compilation.

Tutorial

The Wiki of this repo contains an extensive tutorial covering several topics of Pixel. Here's the content of the tutorial parts so far:

Examples

The examples directory contains a few examples demonstrating Pixel's functionality.

To run an example, navigate to it's directory, then go run the main.go file. For example:

$ cd examples/platformer
$ go run main.go

Here are some screenshots from the examples!

Lights Platformer
Lights Platformer
Smoke Xor
Smoke Xor

Features

Here's the list of the main features in Pixel. Although Pixel is still under heavy development, there should be no major breakage in the API. This is not a 100% guarantee, though.

  • Fast 2D graphics
    • Sprites
    • Primitive shapes with immediate mode style IMDraw (circles, rectangles, lines, ...)
    • Optimized drawing with Batch
  • Simple and convenient API
    • Drawing a sprite to a window is as simple as sprite.Draw(window)
    • Adding and subtracting vectors with + and - operators... how?
    • Wanna know where the center of a window is? window.Bounds().Center()
    • ...
  • Full documentation and tutorial
  • Works on Linux, macOS and Windows
  • Window creation and manipulation (resizing, fullscreen, multiple windows, ...)
  • Keyboard and mouse input without events
  • Well integrated with the Go standard library
    • Use "image" package for loading pictures
    • Use "time" package for measuring delta time and FPS
    • Use "image/color" for colors, or use Pixel's own color.Color format, which supports easy multiplication and a few more features
    • Pixel uses float64 throughout the library, compatible with "math" package
  • Geometry transformations with Matrix
    • Moving, scaling, rotating
    • Easy camera implementation
  • Off-screen drawing to Canvas or any other target (Batch, IMDraw, ...)
  • Fully garbage collected, no Close or Dispose methods
  • Full Porter-Duff composition, which enables
    • 2D lighting
    • Cutting holes into objects
    • Much more...
  • Pixel let's you draw stuff and do your job, it doesn't impose any particular style or paradigm
  • Platform and backend independent core
  • Core Target/Triangles/Picture pattern makes it easy to create new drawing targets that do arbitrarily crazy stuff (e.g. graphical effects)
  • Small codebase, ~5K lines of code, together with the backend glhf package

Missing features

Pixel is in development and still missing few critical features. Here're the most critical ones.

  • Audio
  • Drawing text
  • Antialiasing (filtering is supported, though)
  • Advanced window manipulation (cursor hiding, window icon, ...)
  • Better support for Hi-DPI displays
  • Mobile (and perhaps HTML5?) backend
  • More advanced graphical effects (e.g. blur)
  • Tests and benchmarks

Implementing these features will get us to the 1.0 release. Contribute, so that it's as soon as possible!

Requirements

PixelGL backend uses OpenGL to render graphics. Because of that, OpenGL development libraries are needed for compilation. The dependencies are same as for GLFW.

  • On macOS, you need Xcode or Command Line Tools for Xcode (xcode-select --install) for required headers and libraries.
  • On Ubuntu/Debian-like Linux distributions, you need libgl1-mesa-dev and xorg-dev packages.
  • On CentOS/Fedora-like Linux distributions, you need libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel libXi-devel packages.
  • See here for full details.

Contributing

TODO

License

MIT