[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Rect attributes question
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Rect attributes question
- From: Sam Bull <pygame@xxxxxxxxxxx>
- Date: Sun, 12 Jul 2020 00:25:50 +0100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sat, 11 Jul 2020 19:31:15 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sambull.org; h= message-id:subject:from:to:date:in-reply-to:references :content-type:mime-version; s=fm3; bh=cx84lfzjAv/RtC1DIpxnmnVPcP SOZkCwVrMj0kI/XiY=; b=UuI/J+Wd3VHVybTZJzCvasmwe67HDDsdDU/sPFRBWk 3tdahnb8XAMggKiv1hxj4b1hjkqXk5k9YSJi02JukhzZVWrt4XhsZTNNEgxRGzgE 1Uk3M8XQHq9dolN2UG181WAt02st9oI3sUoT6uD6Ti4xCQKbVgXw2ThyylcXgbDT MlWi43QoA4VRPdcieEUglg7WuqcAAkWaVTftSbTpX54NTDvUNs+2F2YJiKrDTP70 iDshjj/f0RqDUaVxtRV03daIqrTb7d759VQFYxFcC4IRWAIOGkX3xkt1qE8VYPwF cz5KWNLMkyDWwM29m6pjqZrWzDLLEcYBZMNxiYnq9swg==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=cx84lf zjAv/RtC1DIpxnmnVPcPSOZkCwVrMj0kI/XiY=; b=IKxgABna1hdPhdCju79qjw vzPjdCwDTfvri5udA7bDjIN7vk65/I1WQ0Rp70ciAIRwYbbJSDNGtsBGAqG2/9EG r2kZJDuA5STVKYHSdBFAF/r7al2j4rgONwoO0pSyq0C7WrOgPeKLMvYbVSTwnq33 toVdchL5FAi3i165DT0oMNRQNImse3mxJujVyUGZKQJ4z/H0aXYekEaBZe8TcqBX 0mokwZiOHbG6MeNIjaq7n65t8MEXR4sWSBT8tM5f5CqujEdOs+eJeslVjC+Wvpp+ 4WpMDutcT1zNT+OG82D+4J7FG17gMqjsyD5pkkWunq3/Slh+fse2ZoUQR1sZL2qA ==
- In-reply-to: <28717F46-4C56-471A-8B88-9D7EB8576243@furrypants.com>
- References: <000001d64509$08ff4e60$1afdeb20$@earthlink.net> <97b31f55-8bd4-52bb-7334-489a03982148@ntoll.org> <000301d645b1$c3f883a0$4be98ae0$@earthlink.net> <28717F46-4C56-471A-8B88-9D7EB8576243@furrypants.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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
Attachment:
signature.asc
Description: This is a digitally signed message part