1
General / Re: Struggling to make a mapLoader function (Textures don't save)
« on: November 15, 2020, 04:21:55 pm »It's the classic white square problem.Thanks you but the Textures are declared inside the main I do this to prevent it from being destroyed but it still doesn't work (look at the 2nd code it's the correct version)
Your texture instance needs to exist as long as you're using it with a sprite. Since declared the textures in side the mapLoader function, the instances were being destroyed at the end of the function and the sprites pointed to non-existent textures.
I highly recommend to use something like at resource holder.