Kaelan, there exists such a method; not sure how fast it is, but it is cross compatible with XP, VX, and Ace. It is Zeus' Bitmap Export. It includes the ability to save bitmaps to png files as well as dump and load (marshal) bitmaps.
You can find it
here on the forums. 🙂
As for sharing methods, I prefer writing my methods into a module and then including it into classes that need to use them (modularization). I honestly think this is how most of the methods in Window_Base should have been handled, that way your could use them in Sprite if you wanted.
I've tried copying methods from one class to another via bind, define_method with instance_method, they all throw a TypeError (stating that the bind target must be a subclass of the old class).
Evenji: One way for this kind of thing to be useful is the following:
- A script creates a subclass of Window_Base that overwrites Window_Base#draw_text
- You want to subclass said window class, but you want the original method back for draw_text
- You can simply bind the method back to this class, like so:
Code:
class TheirWindow < Window_Base def draw_text(*argv) return #remove draw_text ability (example) endendclass MyWindow < TheirWindow # < Window_Base define_method(:draw_text, Window_Base.instance_method(:draw_text))end
That would give you the original functionality back in your window. I've had to use this a couple of times, actually. It's common that stylizing and aliasing windows between different coders is handled differently, and perhaps you want the functionality of their class, but without one simple redefined feature; so, we can revert it back.