Sep 29, 2018
I would love to hear how you would have done this. I am really bad at creating API
I would return an id when you load the atlas. This way you have them identifiable and there will be no duplicates when you add this as a parameter to your load image command.
@Ferdi: What you need to do is read up on game asset management to find a suitable solution to files with the same name.
*slap forehead* Thanks Mike. I think you better check my code. Make sure I don't do silly things like this.
@dawlane: I like Mike's solution. I had a look at how LibGDX does it. I did not like it. It returns Stack<AtlasImage>, but it also can return individual AtlasImage.
So the code now becomes:
Code (Cerberus X):
Local atlasId:Int = LoadAtlas("td_spritesheet.txt")
' Local atlasId:Int = ATLAS_NULL ' = -1, this is if you want to load individual files
destroyerImg = LoadAtlasImage(atlasId, "sprites/Destroyer.png")
ekstraLiveImg = LoadAtlasImage(atlasId, "sprites/EkstraLive.png")
goldImg = LoadAtlasImage(atlasId, "sprites/Gold.png")
Example 6 bump texture. I had to load the texture using bimg, and it has conflict with Cerberus because both were using stb_image. It is working, but need to do ALOT of clean up underneath. Anyway source code is attached and screenshot:
That looks interesting. Cant wait to play with that target.
Hi Mike, I'll think of something so others can play with the target.
Separate names with a comma.