On Sat, 8 Dec 2007, brian.grogan.jr wrote:
> Pyglet is a great library but two little details bother me in a very
> big way. I really wish that alpha transparent blitting and 2D rotation
> were built into the high-level image API.
I am currently working on a sprite library for pyglet in contrib/spryte. It's
in early stages yet (the API may change.) The intention is that it is capable
of blended blitting, rotation, animation, scaling, tile mapping, picking and
collision detection. It can actually most of that right now, but as I said
the code is quite young. It also depends on the experimental buffer
interface, and i can't vouch for the status of that (except that it's in
the "experimental" folder :)
> I have seen a number of other posts in pyglet-users asking about alpha
> transparency and rotation, and I think it's not really enough to tell
> them to use the OpenGL functions to get the effects. These basic
> effects should be built into the high-level API. I strongly feel that
> it should not be necessary to "drop down" to OpenGL for these two very
> common use cases. The mental context switch from nice pythonic Pyglet
> to C-based OpenGL is jarring and unnecessary.
Alex and I happen to share your view, which is a happy coincidence ;)
... and code is always welcome in an Open Source project written by
volunteers :)
> I think one convenient and non-disruptive (to the current API) way of
> supporting alpha transparency is to give PNG images alpha transparency
> by default (if there is an alpha layer present).
The alpha (transparency) channel from a PNG (or any other RGBA image) is
handled appropriately by pyglet.image. The key is to then instruct OpenGL how
to use that channel. There's dozens of operations that could potentially use
it -- which one is correct for all users of pyglet? It's because of this that
pyglet does not make any assumptions and does not enable any sort of
alpha-channel processing by default.
> And rotation should be in degrees.
The sprite library currently uses radians for rotation. I am on the fence
regarding using degrees, as the code underneath will always be working with
radians, and thus there's a fixed cost of conversion for each rotation API
operation.
Richard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---