So... I wrote a new Rect class to fix these problems.
easy_install rectAlso included in the rect package is a quadtree spatial index, and a rectangle-bin packing function, useful for packing sprite strips, pre-rendered font characters or perhaps tile maps.
>>> from rect import Rect
>>> r = Rect((0,0,10,10))
>>> r.top
10.0
>>> r.bottom
0.0
Update: Oops, a link would be helpful :-) http://cheeseshop.python.org/pypi/Rect/
2 comments:
Rect at the 'Shop
:)
Cool stuff.
I notice that the source code repo seems to have gone missing.
https://code.google.com/p/corsair-redux/wiki/Rect
Is there a new code hosting location? A bit of searching doesn't turn up anything...
I realize I can get the sources from the package but I was just wondering... =)
Post a Comment