I thought there used to be a UserRect to make rects more flexible, but
it seems to be missing from the current pygame docs on pygame.org...
Did I imagine it, or was it removed?
On Sun, 2003-02-23 at 14:42, Gerrit Holl wrote:
Hi,
I am trying to save a game. Is pickling Sprites supposed to work?
When running my game with python -i and checking stuff afterwards,
I get:
What you need to do is either (a) create and user a Pickler that knows
how to pickle Surface (and possibly Rect) objects and/or (b) create a
pickler that knows how to pickle some subclass of Sprite where the
Sprite keeps track of how the Surface was created (as in, from the
image filename or some set of drawing instructions) so it can recreate
the Surface without creating a gigantic pickle. If you combine the
two, you've got a pretty generic solution, but you're probably going to
want to use PIL to convert raw surface data to PNG format or something
of the like and imgstring() it before putting a raw surface into a
pickle that you don't have create instructions for.