[Sugar-devel] [PATCH] adapt pippy examples to screen dimensions, dev.laptop.org #9260
Sascha Silbe
sascha-ml-ui-sugar-devel at silbe.org
Sat Jun 19 09:32:52 EDT 2010
Excerpts from James Cameron's message of Fri May 21 09:42:28 +0000 2010:
> + # fill the screen with white
> + screen.fill((250, 250, 250))
Might it be worth noting that it's just almost-white, with 255 being the maximum (the latter is mentioned in another example, though)?
> image = pygame.image.load("/tmp/pippypic.jpg")
Shouldn't this use the activity tmp directory?
> + # angle and scale the image
s/angle/Rotate/ ?
> + # display the angled and scaled image
dito
> + # (red, green, blue), where 0 <= value < 256
"value <= 255" might be better - give the largest value that still works instead of the first one that doesn't.
> +# FIXME: does not currently work, because no objects are returned by
> +# the journal query.
Ouch, Pippy bundles an ancient copy of Journal code. It should get rid of it and use sugar.datastore.datastore in the examples.
> while pippy.pygame.next_frame():
> - # chill until a key is pressed
> + # chill until escape key is pressed
"the escape key"?
> def run(self):
> - self.running = True
> + self.running = True
> while self.running:
>
> for event in pygame.event.get():
> @@ -84,11 +87,11 @@ class XOlympicsGame:
> if (event.type == KEYDOWN and (event.key == K_UP or event.key == K_KP9)):
At least on Debian, the rocker keys produce KP_Up/..., so it's worth checking for those. Either instead of or in addition to the number keys (event.key in [K_UP, K_KP9, KP_Up]). That way you can play in ebook mode.
Reviewed-By: Sascha Silbe <sascha-pgp at silbe.org>
Sascha
--
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100619/c00a0edf/attachment.pgp
More information about the Sugar-devel
mailing list