otterZ
Member
Thanks to Yal pointing me in the right direction I'm now externally loading PNG images and all is seemingly well. However, I don't know why but I have to declare a variable and assign it twice when adding an external PNG, then using sprite_delete, once in the create event and once again in the destroy event.
If I just declare and assign a variable once and not again in the destroy event an error pops up saying that the external PNG image no longer exists. I wonder if GM2 automatically deletes the externally loaded PNG after it is used? I simply don't know. Here's an example of the coding:
In the manual it says to make sure to use sprite_delete to delete an externally loaded sprite/image or you could run into memory problems, so I want to make sure that it is deleted. I am using Gamemaker Studio 2.
If I just declare and assign a variable once and not again in the destroy event an error pops up saying that the external PNG image no longer exists. I wonder if GM2 automatically deletes the externally loaded PNG after it is used? I simply don't know. Here's an example of the coding:
GML:
// In the create event
spr = sprite_add("external_png",1,0,0,0,0);
// In the destroy event
spr = sprite_add("external_png",1,0,0,0,0); //assigning it twice
sprite_delete(spr);