-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rect does not support floating point coordinates #12
Comments
Original comment by Tim Golden (Bitbucket: TJG, GitHub: TJG): Hmmm. I'm not clear how to proceed on this: we can easily use the Rect subclass I've just created for Issue #11 but we'd have to reimplement every operation to allow for underlying floats, and at some point we'll have to pass the rect to, eg, screen.blit, at which point pygame will presumably complain because the numbers are floats. Or are you simply suggesting that we store (and display) floats but that all the properties (x, y, topleft etc.) return integers as at present? |
Original comment by Tim Golden (Bitbucket: TJG, GitHub: TJG): Seems to the me that the fix in pygame would be too far-reaching and I'll try sketching out a pgzero on the back of Issue #11 which holds |
Original comment by Daniel Pope (Bitbucket: lordmauve, GitHub: lordmauve): The ZRect class has been implemented to fix this. @tjg and I had a chat offline about the implications of bringing this in and the compatibility problems of doing so. We decided to hold off for the moment. ZRect is available if you need it, but it is clearly different to the default Rect objects in Pygame and Pygame Zero. |
We should document the use of ZRect. |
Originally reported by: Daniel Pope (Bitbucket: lordmauve, GitHub: lordmauve)
This is confusing:
It is inconsistent with Python's own number types, because Python tries to minimise the distinction between integral and float types.
The text was updated successfully, but these errors were encountered: