I've never really been a fan of using Strings and hash maps to store and use my game's images. It leads to ugly code, and a small performance impact (I know... premature optimization blah blah). There is also no compile-time checking or content assist, which I've fallen in love with since the introduction of enums and generics.

So here is a crazy idea... Let's say you're already pre-processing your game's assets into texture atlases with a tool like Texturepacker-GUI or TexturePacker2. During this step, we could also generate a Java source file for an Enum class which contains all of our resources. For example, take the following input images that will be packed into a TextureAtlas:

btw I already did something like that- a compiler plugin which automaticly packs all images which are used by your game into a texture atlass at compile time.- a infrastructure which would enable custom generation stuff

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org