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

Re: [SPAM: 5.000] Re: [pygame] Native PyGame method for automatically scaling inputs to a surface resolution?



Mac Ryan wrote:

The behaviour that I envisage would be an
optional keyword argument ``scale=1.0`` for rectangles (and surfaces).

I would say the transformation should be an attribute of the
surface, not something that you pass into drawing calls. Also
it should allow for both scaling and translation, independently
in each direction.

Ideally it should be a general linear transformation, but that
would probably require totally re-thinking the way drawing
operations are implemented (e.g. rotated ellipses would blow
pygame.draw's tiny mind at the moment).

My point wasn't really the fact that I'm lacking speed. For me it is
more a question of good code design.

If you're not concerned about speed, then rather than wrapping
the drawing functions, you could consider wrapping the surface
with an object that holds the transformation and provides
drawing methods. Such a wrapper would behaves something like
the enhanced surface object I proposed above.

--
Greg