RPG::Cache
A module that loads each of RPGXP's graphic formats, creates a Bitmap object, and retains it.
To speed up load times and conserve memory, this module holds the created Bitmap object in an internal hash, allowing the program to return preexisting objects when the same bitmap is requested again.
This feature means you must take care not to use Bitmap#dispose to free the bitmaps specified in the origins of other sprites. If those objects have already been freed when a bitmap is requested, the objects will automatically be recreated, so it is safe to free the object if you are certain it is not referenced elsewhere. Bitmaps consume a large amount of memory, so make it a practice to free bitmaps you use only rarely.
If the specified file name is an empty string, the module will create and return a 32 x 32 pixel bitmap. This ensures compatibility with RPGXP's "(None)" designation.
Module Methods
RPG::Cache.animation(filename, hue)
Gets an animation graphic. Use hue to adjust its hue values.
RPG::Cache.autotile(filename)
Gets an autotile graphic.
RPG::Cache.battleback(filename)
Gets a battle background graphic.
RPG::Cache.battler(filename, hue)
Gets a battler graphic. Use hue to adjust its hue values.
RPG::Cache.character(filename, hue)
Gets a character graphic. Use hue to adjust its hue values.
RPG::Cache.fog(filename, hue)
Gets a fog graphic. Use hue to adjust its hue values.
RPG::Cache.gameover(filename)
Gets a "Game Over" graphic.
RPG::Cache.icon(filename)
Gets an icon graphic.
RPG::Cache.panorama(filename, hue)
Gets a panorama graphic. Use hue to adjust its hue values.
RPG::Cache.picture(filename)
Gets a picture graphic.
RPG::Cache.tileset(filename)
Gets a tileset graphic.
RPG::Cache.title(filename)
Gets a title graphic.
RPG::Cache.windowskin(filename)
Gets a window skin graphic.
RPG::Cache.tile(filename, tile_id, hue)
Gets only a specified tile from a tileset. Use tile_id to specify the ID of the tile to retrieve and hue to adjust its hue values.
Used when a tile is specified in an event graphic (RPG::Event::Page::Graphic).
RPG::Cache.clear
Empties the cache.
Definition
Last updated