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

Re: [pygame] Fill a Rect object with color?



On Sat, Nov 7, 2009 at 10:34 AM, Yanom Mobis <yanom@xxxxxxxxxxxxxx> wrote:
This is kind of embarrasing but I forgot how to fill a rect object with a certain color.

Here's everything so you can see the full context.

import pygame
from pygame.locals import *
pygame.init()
pygame.display.set_mode((800,600))
s = pygame.display.get_surface()
r = pygame.Rect(100,100,100,100)
s.fill(Color("red"), r)
pygame.display.flip()
while 1:
    pygame.event.get()