Discuz! Board

 

 

Search
Discuz! Board Forum Integration Questions Unloading Sprite Sheets
View: 742|Reply: 5
go

Unloading Sprite Sheets

Rank: 4

Post on 2012-3-28 18:17 |All posts
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!

Rank: 2

Post on 2012-4-3 01:51 |All posts
you can remove the node by using node.removefromparente() api.  

Hope this helps.

Thanks.

Rank: 4

Post on 2012-4-3 17:19 |All posts
There is no handler for a loaded sprite sheet.. So I cannot call removefromparent on it!

Rank: 2

Post on 2012-4-4 01:47 |All posts
could you provide the code?
If you mind sharing it in public, you can always send an email to techsupport@papayamobile.com.

Thanks.

Rank: 4

Post on 2012-4-4 18:37 |All posts
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??

Rank: 2

Post on 2012-4-12 09:30 |All posts
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.
Security Q&A Change Security code Change

Archiver|Comsenz Inc.

All time is GMT+8, 2013-6-19 22:56 , Processed in 0.030550 second(s), 10 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.