diff options
author | Ignacio RodrÃguez <ignaciorodriguez@sugarlabs.org> | 2012-10-13 12:17:00 (GMT) |
---|---|---|
committer | Ignacio RodrÃguez <ignaciorodriguez@sugarlabs.org> | 2012-10-13 12:17:00 (GMT) |
commit | 2dafb24713afdb471c42072e5edb11d49d34effe (patch) | |
tree | 6ac0e3e979701b83f06388ace1873d564fc87f50 | |
parent | 8a04cc24ccfabff5f23936206df4744d00e2d530 (diff) |
Walter Bender, me ayudo..
-rw-r--r-- | Anotations_Walter.txt | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Anotations_Walter.txt b/Anotations_Walter.txt new file mode 100644 index 0000000..ef082bb --- /dev/null +++ b/Anotations_Walter.txt @@ -0,0 +1,42 @@ +(1) Grab the latest sprites.py from here [1] (I made some changes) + +(2) In game.py, you need event handlers for draw: + self._canvas.connect('draw', self.__draw_cb) + +and the corresponding method: + def __draw_cb(self, canvas, cr): + self._sprites.redraw_sprites(cr=cr) + +(3) In game.py, you need an __expose_cb: + + def __expose_cb(self, win, event): + ''' Callback to handle window expose events ''' + self.do_expose_event(event) + return True + + # Handle the expose-event by drawing + def do_expose_event(self, event): + + # Create the cairo context + cr = self._canvas.window.cairo_create() + + # Restrict Cairo to the exposed area; avoid extra work + cr.rectangle(event.area.x, event.area.y, + event.area.width, event.area.height) + cr.clip() + + # Refresh sprite list + if cr is not None: + self._sprites.redraw_sprites(cr=cr) + +(4) Also, in game.py: + surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, + self._svg_width, self._svg_height) + context = cairo.Context(surface) + Gdk.cairo_set_source_pixbuf(context, pixbuf, 0, 0) + +(5) Please add a summary field to activity.info: + +summary = prompts learner to tell a story by displaying images at random + +good luck. |