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.

[RGSS] Creating a new graphics folder

Creating a new graphics folder

If you're anything like me, your pictures folder will be full of junk by now. Well, with this tutorial you can create a new folder to store them in!

First, open the game folder, and go to \Graphics.

Right click > New folder. Rename this folder to anything you want. For this example I will call it "Faces".

Now go to the script editor, and create a new blank entry.

We are going to use Module RPG::Cache for this, as this is what the game uses to access such folders. The game already has some built-in, but to add more we must do it ourselves.

Code:
module RPG
  module Cache
    def self.faces(filename)
      self.load_bitmap("Graphics/Faces/", filename)
    end
  end
end

Now, to call such images, we just need to put the filename as "RPG::Cache.faces('filename')" as we would normally do with the image folders in the game maker already.

So to change a sprite's bitmap to that of the face "arshes.png" we would do the following:

Code:
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.faces("arshes.png")

You don't need to add the .png, but I find it helps in case you have the same filename used for different file types (i.e. JPG).
 
This can be useful. Will this also work for the icon folder. Since it's overwhelming especially is you use like 200 icons in a game.
 
Yes, but unfortunately the extra folders wont work in the editor, only in scrpting. (So you can't view the extra icon folders in the editor).

You'd do it like so:

1. Create a new folder within Graphics\Icons
2. Add this:

Code:
module RPG
  module Cache
    def self.icon_2(filename)
      self.load_bitmap("Graphics/Icons/Folder2", filename)
    end
  end
end

Where Folder2 is the name of the icon.

Then to add them to a script, something like:

@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.icon_2(image_name)

A way this can be used for items in the database though, is using the Virtual Database by (I think) Trickster.
 

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