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

Re: [pygame] question on rect properties



On 10/9/06, altern <altern2@xxxxxxxxx> wrote:
hi

if i change the width or height of a pygame rect, the center property
changes as well, doesnt it? This is because center is relative to the
top, left. Am i right on this?

When you change the width, height or size properties of a pygame rect, the top and left are not changed, so yes: the center is adjusted.

If you want to change the size of a rect, but keep the same center you
should use the inflate of inflate_ip methods.

Cheers,
--
alecu