something simple. It has bothered me since long that I had only one folder where I should put all textures of my project - just one! You can imagine that this can quickly become disorganized.
BufferedImage image = ImageIO.read(new File("./res/textures/" + fileName));
This little piece of code will allow me to get the respective file from the textures folder within my project, java can only find the 'fileName' String within this single folder.
Since I want to have multiple folders within the textures folder, I want to know if and how it is possible to tell java that it needs to check all folders within the 'textures' folder for any given 'fileName', has anyone a suggestion?
fileNamecontain the subfolder prefix/ground/stone.pngfor example. You could use eitherstatic finalconstants for each "group" or anenum,Textures.GROUND.load("stone.png")which could generate the path to the "ground" textures folder and suffix the image namePathsto Walk a file tree - but this is VERY inefficient. It'd be better to pre-scan the directories and generate aMapof each texture by name