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

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

On Tue, 27 Sep 2011 11:28:34 -0400
Christopher Night <cosmologicon@xxxxxxxxx> wrote:

> How can I use your system to draw a rectangle of a solid color onto a
> surface? With the regular pygame system, I would use surf.fill and
> pass it a Rect. If your system doesn't recognize rectangles of any
> sort, how can I do this? Feel free to show me in pseudocode how I
> could do it.

I suppose you mean something like:

>>> Surface.fill(WHITE, myrect)

is it?

If this is the case, the rectangle would be scaled (so a rect of
100x200 would be scaled to a rect of 10x20 assuming scale=0.1). The
general idea would be: any argument to a surface method whose purpose
is to indicate a measure ((x,y) tuples, explicit width/height or tuples)
would be scaled. Any other parameter whose purpose is not defining
coordinates (colours, flags, surfaces...) wouldn't.

Again: not claiming this is the best way of doing it... just that this
is how I would try to implement it....