GLBasic forum

Main forum => GLBasic - en => Topic started by: bigtunacan on 2012-Jul-29

Title: GENSPRITE() and Image cleanup
Post by: bigtunacan on 2012-Jul-29
How do I cleanup an image that has been loaded via LOADSPRITE so that it's index will get reused again by GENSPRITE() ?
Title: Re: GENSPRITE() and Image cleanup
Post by: MrTAToad on 2012-Jul-30
Use LOADSPRITE "",x - with x as the ID
Title: Re: GENSPRITE() and Image cleanup
Post by: Schranz0r on 2012-Jul-30
Code (glbasic) Select
FUNCTION FREESPRITE: id#
    LOADSPRITE "", id
ENDFUNCTION


what MRTAToad say :)
Title: Re: GENSPRITE() and Image cleanup
Post by: mentalthink on 2012-Jul-30
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...
Title: Re: GENSPRITE() and Image cleanup
Post by: matchy on 2012-Jul-30
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.