How does loading the graphics work in the engine?

So for the plugin i am creating it would be helpful to know how the engine goes about loading the following;

Icons
Enemy graphics
Tileset graphics
Face graphics
Event graphics*

basically i am trying to figure out what is responsible for loading them so i can just copy the function and make a version that looks in a specified path rather than the default "img" folder...yet i have no idea how this would work as looking into the code somewhat related to it i got very lost. I would appreciate any help that can be offered!
Loading is done by the ImageManager class for all of them, but each of those is drawn in a different way.
Loading is done by the ImageManager class for all of them, but each of those is drawn in a different way.

Oh, well, that was easy, i can literally just...copy that and change where it looks based on stuff...Thanks!

I just have to figure out the smart way of messing with that, would their be a way to get information about what called the function? Or any clean-ish way of being able to determine what to load instead?

Edit: I suppose i could do something a bit sneaky with how it loads things, i noticed that it passes a string for the filename when loading the graphic to make a full path, instead of giving it just a filename we could give it a full path instead with some editing
The ImageManager has code that fills in the first half of the path. If you just want SOME images to load from a different location, but ALL of those particular types of images to do so, you would just have to override that particular function in ImageManager so it didn't call the default 'load' function.
The ImageManager has code that fills in the first half of the path. If you just want SOME images to load from a different location, but ALL of those particular types of images to do so, you would just have to override that particular function in ImageManager so it didn't call the default 'load' function.
I noticed that icons werent included in there, do you know where they are handled? annnd admiditly it sounds like it would be a decent bit of going through and changing things but it seems doable
Everything in the System folder is loaded on game launch. They'll be done in rpg_scenes somewhere. Just search for iconset
Everything in the System folder is loaded on game launch. They'll be done in rpg_scenes somewhere. Just search for iconset

Do you know how the actual icons are drawn?

What i am looking to do is more along those lines to be honest; specify the icon sheet that it will draw from when it told to draw one?
This is something you could look up yourself fairly easily.

rpg_windows.js

Code:
Window_Base.prototype.drawIcon = function(iconIndex, x, y) {
    var bitmap = ImageManager.loadSystem('IconSet');
    var pw = Window_Base._iconWidth;
    var ph = Window_Base._iconHeight;
    var sx = iconIndex % 16 * pw;
    var sy = Math.floor(iconIndex / 16) * ph;
    this.contents.blt(bitmap, sx, sy, pw, ph, x, y);
};
This is something you could look up yourself fairly easily.

rpg_windows.js

Code:
Window_Base.prototype.drawIcon = function(iconIndex, x, y) {
    var bitmap = ImageManager.loadSystem('IconSet');
    var pw = Window_Base._iconWidth;
    var ph = Window_Base._iconHeight;
    var sx = iconIndex % 16 * pw;
    var sy = Math.floor(iconIndex / 16) * ph;
    this.contents.blt(bitmap, sx, sy, pw, ph, x, y);
};

Thanks for the help, I thiiiink i can handle it on my own from here, have a good night!

Original thread: https://forums.rpgmakerweb.com/threads/how-does-loading-the-graphics-work-in-the-engine.117225/