Discuz! Board's Archiver

uzair187 posted on 2012-3-28 18:17

Unloading Sprite Sheets

Hey,
Is there any way to unload the sprite sheets? I have loaded the sprite sheets using load_sprite_sheet(...)  method, and I want to unload and remove it from the memory after usage and load another one!

devilcoke posted on 2012-4-3 01:51

you can remove the node by using node.removefromparente() api.  

Hope this helps.

Thanks.

uzair187 posted on 2012-4-3 17:19

There is no handler for a loaded sprite sheet.. So I cannot call removefromparent on it!

devilcoke posted on 2012-4-4 01:47

could you provide the code?
If you mind sharing it in public, you can always send an email to [email]techsupport@papayamobile.com[/email].

Thanks.

uzair187 posted on 2012-4-4 18:37

Here's how I'm loading the spritesheet:
load_sprite_sheet( "filename",0,spriteSheetCallback,theUserData);
function spriteSheetCallback(fileName,result,theUserData)
{
   //doing stuff, showing sprites from the sprite sheet etc..
}

Now after I am done using the sprites from the sprite sheet, I want to unload that sprite sheet to free up memory it took .... How to do that??

devilcoke posted on 2012-4-12 09:30

when you showing sprite, you can assign it to variable.  If you want to variable, when you want to remove it then please call removefromparent on the variable.

Thanks.
Page: [1]

Powered by Discuz! X1.5 Archiver   © 2001-2010 Comsenz Inc.