GENSPRITE() and Image cleanup

Previous topic - Next topic

bigtunacan

How do I cleanup an image that has been loaded via LOADSPRITE so that it's index will get reused again by GENSPRITE() ?

MrTAToad

Use LOADSPRITE "",x - with x as the ID

Schranz0r

Code (glbasic) Select
FUNCTION FREESPRITE: id#
    LOADSPRITE "", id
ENDFUNCTION


what MRTAToad say :)
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

mentalthink

or something in loadsprite "don´t exist sprite" something like spr_Null, and null it´s nothing in media Folder

I use this mode for a bit more clear in the Code...

matchy

The only reason, I can see, to LOADSPRITE "" is to clear memory if new images are being load continuously. Other than that, there's no need to regenerate new GENSPRITE() id to be reused again.