[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] floating-point Rect?



Matt Campbell wrote:
Pygame's Rect class appears to be integer-only. Is there a floating-point variant, or is that something I'll need to make if I want one?

My reasoning is that texture coordinates, etc are usually 0..1, and I want to use something like a Rect to hold them...
integer only i'm afraid. the Rect is actually just a python type built on top of the SDL_Rect structure. in hindsight, i see a need for all floating point positions, even if the final blitting is done at integer positions. using them for texture coordinates is one more reason.

perhaps in the future this will happen, but i'd say you'll need your own for the time being.