[Tutor] pygame blinking text
Cranky Frankie
cranky.frankie at gmail.com
Mon Dec 12 15:01:28 CET 2011
My Python presentation is just about complete. As a nice ending I want
to do a pygame program that displays the group's .jpg, with the words
"Thank You!" blinking, say on for a second and off for a second.
Unfortunatley, I can't get the works to blink, but I can get them to
appear for a short time:
from livewires import games, color
games.init(screen_width = 640, screen_height = 480, fps = 50)
bg_image = games.load_image("AEMUG640x480.JPG", transparent = False)
games.screen.background = bg_image
ty_message = games.Message(value = "Thank You!",
size = 100,
color = color.red,
x = games.screen.width/2,
y = games.screen.height/2,
lifetime = 100,
after_death = 0)
games.screen.add(ty_message)
games.screen.mainloop()
I tried putting the ty_message block in a WHILE TRUE loop, and that
didn't work. Then I tried the same with the
games.screen.add(ty_message) line and that didn't work either. I think
what might work is if I can find a way to delete the ty_message and
readd it, over and over in a loop with a delay, bu:
games.screen.delete(ty_message)
doesn't work - delete is not a valid method.
Is there any way to get blinking text with pygame? This is not a deal
breaker, but I thought the blinking text would be neat.
--
Frank L. "Cranky Frankie" Palmeri
More information about the Tutor
mailing list