Hello all, I would like to serialize some information about an image in the same file as it but I can't because that would mean serializing the window attribute as well. Its hard to explain... but my game loads files and serializes them rather than loading a .png. I was wondering If I could create a Gosu::Image object without specifying a window variable so that the serialized Gosu::Image could be used in any window, understand? Sorry if I am not clarifying the concept clearly enough, thanks in advance, ell.
The bitmap class wouldn't help I think. Even in C++ Gosu, there is no way to get the content of an image back because there is no way to change the content anyway after loading from a file.
Since there is only one Window instance anyway, I guess you could just use Ruby's ObjectSpace to look for it until Gosu gets rid of the "window" parameter.
By ?
Date 2010-03-12 14:25
Hey again guys, sorry for the late reply, went to Conway on a school trip :) Thanks, that cleared things up a bit! I think I'l just go with it loading .png files on there own, or if needs be it can load any extra information from a file with the same name but a different extension so I can have an image file and an image info file. Thanks again, you'v been great, ell.