Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

HOw to build my own RPG.Cache modules

I want to create a separate folder for 'special bitmaps' which I dont want to put in my 'pictures' folder. How can I make a different folder and access bitmaps from it??

thank you.
 

Zeriab

Sponsor

You can do it like this: (Paste in its own section anywhere above main)
[rgss]module RPG
  module Cache
    def self.special_bitmap(filename)
      self.load_bitmap("Graphics/SpecialBitmaps/", filename)
    end
  end
end
[/rgss]

I am not sure how touchy spaces are in path names so I removed it.
Just put your special bitmaps in a SpecialBitmaps folder in the Graphics folder.
Use RPG::Cache.special_bitmap(filename) to access the bitmaps in the folder.

*hugs*
- Zeriab
 
Man, I love you (no homo). THANKS A LOT.

By the way:
1. why does IT uses two modules, one inside the other?
2. What other files can I open like this (besides bitmaps?)


Thank you very much
 
1) Just an organization setup. This is the same:
Code:
module RPG::Cache

  def self.special_bitmap(filename)

    self.load_bitmap("Graphics/SpecialBitmaps/", filename)

  end

end

2) Pretty much anything you want. It all depends on what type of file it is and how you saved it.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top