[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pygame] feature request?
Ben Smith wrote:
> I've been using the Rect type recently and I'd really like to set a rect's
> absolute position for the upper left corner
already done, and (hopefully) easier than you had imagined.
the Rect objects have several attributes, like "topleft", "center", etc
these can also be assigned to, and the Rect will move to make the
assignment work.
therefore, to do something like position an object on the lowerright
corner of the screen...
myobject.rect.bottomright = screen.rect.bottomright
here's a quick snip from the pygame docs..
> Rect contains helpful methods, as well as a list of modifiable members:
> top, bottom, left, right, topleft, topright, bottomleft, bottomright,
> size, width, height, center, centerx, centery, midleft, midright,
> midtop, midbottom. When changing thesemembers, the rectangle will be
> moved to the given assignment. (except when changing the size, width, or
> height member, which will resize the rectangle from the topleft corner)
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org