Moin moin,
sorry for letting you wait!
If you have your resource folders properly defined on the build path, it's usually as simple as calling ResourcesContainer.get()
- just the way it works if the resources are part of the ResourcesBundle. For Spritesheets, you need to call Resources.spritesheets().load(...)
first, since Spritesheets are not an ordinary resource, but a wrapper for images.
Assume the following file structure:
├MyGameRootFolder
├misc
| ├cursor.png
| └icons
| ├heart.png
| └coin.png
├spritesheets
| ├wario-walk-left.png
| ├wario-walk-up.png
| └wario-walk-down.png
└sounds
├waaaaaaaaaaaah.ogg
└waaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhh.wav
You can load the different resource types with the following approach:
BufferedImage cursor= Resources.images().get("cursor.png");
Icon heart = new ImageIcon(Resources.images().get("icons/heart.png"));
Icon coin = new ImageIcon(Resources.images().get("icons/coin.png"));
Sound wah1 = Resources.sounds().get("waaaaaaaaaaaah.ogg");
Sound wah2 = Resources.sounds().get("waaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhh.wav");
Spritesheet walk_up = Resources.spritesheets().load("wario-walk-up.png", 64, 64);
Spritesheet walk_down = Resources.spritesheets().load("wario-walk-down.png", 64, 64);
Spritesheet walk_left = Resources.spritesheets().load("wario-walk-left.png", 64, 64);
The other resource types behave similarly.
Does this help you?
p.S.: You can also load Resources with plain Java and then explicitly add them to the Respective ResourcesContainer, but the approach described above is preferable.