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

Re: [pygame] draw.rect question real simple



Lamonte Harris wrote:
So basically pygame.draw.rect basically draws on the rect onto the surface, so its not actually assigned to anything(such as a variable).

Right; it just performs the action of drawing a rectangle on the specified surface. Note, though, that according to:
http://pygame.org/docs/ref/draw.html#pygame.draw.rect
the function returns a Rect object (nearly the same thing as a 4-entry tuple) which you can ignore. If you really wanted to know where the rect was drawn, you could capture that return value like so:
spam = pygame.draw.rect(...)
print spam

In terms of it being "assigned to" something, it's a function of the pygame.draw module.