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

Re: [pygame] Rect attributes question



How can I stop receive e-mails from this list?

Atenciosamente,

Wener Wagner Brito Castro


On Sat, Jul 11, 2020 at 9:41 PM Irv Kalb <Irv@xxxxxxxxxxxxxx> wrote:
Thanks very much.  It's even simpler than I thought.

Irv

> On Jul 11, 2020, at 4:25 PM, Sam Bull <pygame@xxxxxxxxxxx> wrote:
>
> On Sat, 2020-07-11 at 14:19 -0700, Irv Kalb wrote:
>> is this implemented with a property of a rect object, so it's actually calling
>> a method with a property decorator?  This would seem to be the case because I
>> am changing just one value (left), but other values also change along with it
>> - not only the right, but .center, etc.
>
> You've got the right idea, but this appears to actually be implemented in C.
> There is a getter/setter for each attribute. The only attributes actually being
> stored are x, y, width, height, everything else is being converted.
>
> https://github.com/pygame/pygame/blob/master/src_c/rect.c#L1990