GLBasic forum

Main forum => GLBasic - en => Topic started by: r0ber7 on 2012-Dec-03

Title: Gensprite() memory allocation
Post by: r0ber7 on 2012-Dec-03
Question...

I'm drawing a text balloon on screen. The balloon is variable in width and height depending on the size of the text. I'm using a CREATESCREEN & GENSPRITE combination to make fitting balloons for all messages. But once I've made them, and displayed them, I really have no more use for the sprites I created with GENSPRITE.

Where do they go? :)

I assume they keep hanging around in memory, which is not ideal. Is there a way to free sprite memory allocated through GENSPRITE? If not, I'll probably use a looping array of sprite IDs or something.
Title: Re: Gensprite() memory allocation
Post by: Crivens on 2012-Dec-03
LOADSPRITE "",spriteid should free memory.

Cheers
Title: Re: Gensprite() memory allocation
Post by: r0ber7 on 2012-Dec-03
Sweet! Thanks.  :good: