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

Re: [pygame] moving a filled circle from top to bottom



Thanks for your reply! 

On Wed, Sep 29, 2010 at 9:49 PM, B W <stabbingfinger@xxxxxxxxx> wrote:
Hi, Kevin.

You already created the example. :) Just replace the few lines in your __init__ method.

Note that this is not a "better" way of doing it. It's just an approach that I find easier to work with when computing your graphics, i.e. "procedural" graphics.

When you load your graphics from an image file, you get a surface sized to fit the image and can get your rect from it. In contrast, when computing your own graphics it might help to create your dimensions first (the rect) and use the rect in plotting your graphics primitives.

Hope that explanation helps.

Gumm

On Wed, Sep 29, 2010 at 8:43 PM, kevin hayes <kevinosky@xxxxxxxxx> wrote:
Hey...my apologies for taking so long to get back to you, I was staying at a friend's house for a couple of days. I honestly don't understand your email. Maybe you could give me a small example...if you wish.


On Mon, Sep 27, 2010 at 9:00 PM, B W <stabbingfinger@xxxxxxxxx> wrote:
Changing the order might help with procedural images. Then you can make the rect's attributes work for you.

        self.rect = pygame.Rect(0,0,50,50)
        self.image = pygame.surface.Surface(self.rect.size)
        pygame.draw.circle(self.image, pygame.Color(0, 0, 255), self.rect.center, self.rect.width/2)
        self.image.set_colorkey(pygame.Color('black'))
        self.rect.center = 320,0

Gumm