Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/remogatto/shapes

A package for rendering simple two-dimensional shapes on an OpenGL ES 2 context
https://github.com/remogatto/shapes

Last synced: 2 months ago
JSON representation

A package for rendering simple two-dimensional shapes on an OpenGL ES 2 context

Awesome Lists containing this project

README

        

# Shapes [![GoDoc](https://godoc.org/github.com/remogatto/shapes?status.png)](http://godoc.org/github.com/remogatto/shapes)

shapes is a small package for drawing simple two-dimensional
shapes on an OpenGL ES 2 context. Used in conjuction with
[Mandala](https://github.com/remogatto/mandala) it provides a quick way to represent geometric
2D objects on Android games.

# Example API

~~~go
// Create a 100x100 pixels² box
box := NewBox(100, 100)

// Place the box at a given position
box.Position(10, 10)

// Assign a color to it
box.Color(color.White)

// Attach the box to a world object (see World interface)
box.AttachToWorld(world)

// Render the box on the surface
box.Draw()

// swap the buffers
~~~

# Supported shapes

* Box
* Segment

# Test

See [test](test/) for a black-box testing approach.

# LICENSE

See [LICENSE](LICENSE)