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

Re: [pygame] Fw: rect.center.. confusion over result.. or bad result?



thanks for putting up with my denseness and replying :-)
----- Original Message ----- From: "René Dudfield" <renesd@xxxxxxxxx>
To: <pygame-users@xxxxxxxx>
Sent: Thursday, December 04, 2008 4:49 PM
Subject: Re: [pygame] Fw: rect.center.. confusion over result.. or bad result?


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!