[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] screen.fill() not working
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] screen.fill() not working
- From: "Thiago Chaves" <shundread@xxxxxxxxx>
- Date: Sun, 11 Jan 2009 03:16:12 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sat, 10 Jan 2009 20:16:15 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=UuaaoQRkVmNXRHMclYHkp3lhHWTqfAEezbAxFrthr7c=; b=MN/s5LG/LicESqsqSrL3OQyb8E5z0qTooeAzyf51n1eypwRAfppYxWjfmOEOW+YgbM LPK8j03Y0mrfH5jhgc6qqmK7x34bA15MjaUZYpEWrYfgKHTYKeKI8flLYXuFBZ6rp6HQ TVwsw4AbHk9KYib2ZUOqPTXngsBCiF6fgWh6U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=DOE9P3OZNUUb6LQOUnbb0YJfELPKWY2SduYbpxpldpfn7KnuDTRf2R4XvX2+/BQiSf mqM41uEX2z44WRFQkMQL0ZYcIYgWevbyjiwPCmrOm2byxPSvDyDc3RPvDDlKjR13g07I MBlv9IyIq4ggcf8xydcxkMVVrW8xphGWmoL1Q=
- In-reply-to: <228307.7332.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- References: <228307.7332.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi,
You forgot to update the screen.
http://www.pygame.org/docs/ref/display.html#pygame.display.flip
You should call either pygame.display.flip or pygame.display.update
after you finish drawing on the screen.
-Thiago
On Sat, Jan 10, 2009 at 10:26 PM, Yanom Mobis <yanom@xxxxxxxxxxxxxx> wrote:
> Ok, I was starting to write a game, so i wrote this code:
>
> import sys, pygame
> from pygame.locals import *
> screen = pygame.display.set_mode((500, 200),0,32)
> clock = pygame.time.Clock()
> bgc = 150, 150, 80
> redcar = pygame.image.load("redcar.png").convert_alpha()
> while True: #main loop
> clock.tick(30)
> for event in pygame.event.get(): #every game has one
> if event.type == QUIT:
> exit()
> screen.fill(bgc)
>
>
> but when I run it, the screen is black, not the color I specified.
>
>
>
>
>
>