[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Fw: rect.center.. confusion over result.. or bad result?
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Fw: rect.center.. confusion over result.. or bad result?
- From: "René Dudfield" <renesd@xxxxxxxxx>
- Date: Fri, 5 Dec 2008 11:49:59 +1100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 04 Dec 2008 19:50:03 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=RSvNP2WjWgMeXV5YNtKtsGYTT5TDZ6qmh+kqqKwER4U=; b=i5PNWID47KkCBZwbu7bYa6zWF+Se+RkgojAbKuwn7i2ujCHuCZwDmqWk8habGWe3/+ eJh1mfFiBfi0zW0+Cwt/ofbow22RUBXpl/oMjLQqpVSwbH1KEM2ln3W/86fqyiZqc2cJ 1OuP5OCAnCMlOFMdaCN816+pAFZvV6//rZQrI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=bPTx6WIwRUBNP2EhjhYIWfRhxfDuLR0lGGgNpNUSfPx3Ng6uYwoOEvwR22rmZWMGB/ 5C372Dp7S0FghsDyo5xnfoIg0UyVZBOwjWUivZMgq2wZe6z+cZUPNxZkSAyic5OHgCPR 1cx8hFB9aIVzhnEpk18EwATgRPpp+sqBwpcLY=
- In-reply-to: <555C7E204C7D4AF5BF021838E9F2EC1F@ChestnutTree>
- References: <555C7E204C7D4AF5BF021838E9F2EC1F@ChestnutTree>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
hi,
>>> (85 / 2.) + 44
86.5
It divides the height by two, and then adjusts it by the y coordinate.
cu.
On Fri, Dec 5, 2008 at 11:44 AM, Lin Parkh <lparkh@xxxxxxxxxxx> wrote:
>
> I think I am confused about what center of a rectangle is becaue I am
> getting an "odd" (to me) result.
> Specifically:
> #I define a rectangle:
>
> tes =pygame.Rect(0,44,200,85)
>
> #now i would expect the center of this rectangle to be be
> ((200+0)/2),(44+85)/2)) in other words (100, 64) instead I get:
>
> tes.center
>
> (100, 86)
>
> Where did the 86 come from????
> Please advise. Thanks for any help!