Introducing Gloss


Taking a short break from his coding academy, Hudzilla has spent the last few weeks touring Italy and - believe it or not - fiddling around with Python. The first fruits of his effort are now available for world + dog to try, so if you're looking for something new to hack on, continue reading to hear from the man himself...

Everyone knows Pygame is a super-fast way to produce cross-platform games. But its one major flaw is that it's very slow to do simple operations such as scaling, rotating and recoloring. In fact, even making extensive use of transparency can be a bit slow, so I've produced a new graphics toolkit that makes all those things extremely fast, and I've called it Gloss.

Here's what Gloss lets you do:

  • Scale, rotate and recolor textures and text in real time
  • Create particle systems for explosions and other effects
  • Render your scene to a texture for use elsewhere
  • Assign callback functions for events such as mouse clicks and key presses

Plus I've also thrown in helpful mathematical functions such as vector normalisation, lerping (optionally with easing), and more. In short, it builds upon Pygame by replacing its SDL rendering system with a new OpenGL backend, then hides the event pump behind a nicer callback system and drops in some helpful game mathematics to finish things off. Lots of parameters to Gloss methods specify smart default parameters so that you need only fill in what you need. And yes, before you ask, it's all available under a free software licence - the GPL 3, to be precise.

If you'd like to give Gloss a try, zip on over to the Gloss homepage, where you'll be able to download the first release, optimistically numbered 0.5. The download includes documentation for every object and function, plus a tutorial and example code to help get you started.

NB: this is the first release of Gloss, so expect bugs! If you find any, please drop me an email and I'll get on the case.

Have fun! Now, back to the coding academy...

You should follow us on or Twitter

Your comments

Looking interesting!

Going to give this a brief try-out.

- but

Conveniently forgot screenshots, but I suppose that is forthcoming?

3d toolkit

Will this ever progress into a full 3d toolkit

Nice, but cross-platform?

This sounds very nice! However, I want my game to be cross-platform... So my question is: does Gloss work well in Windows or on Macs too?


I'm having trouble getting it to package as an exe via py2exe

I get

path...\examples\dist\example_particles.exe\ RuntimeWarning: use mixer: MemoryLoadLibrary failed loading pygame\mixer.pyd
Traceback (most recent call last):
File "", line 58, in <module>
File "gloss.pyo", line 159, in run
File "gloss.pyo", line 76, in gloss_initialise
File "pygame\__init__.pyo", line 70, in __getattr__
NotImplementedError: mixer module not available

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Username:   Password: