Hey guys,
I have a question regards to when the sprite sheet is loaded to memory?
I have a scene that contains lots of big sprite sheets, about 10 files of 1024x1024
The thing is, there is no scenario when 2 sprite sheets are used simultaneously, and also there is the fact that maybe not all of them will be used.
So thats why im asking about RAM, I want only the used sheets to be loaded to memory.
The way I set it up is like this for example:
[lua]
local thunderOptions = {
width =128,
height = 128,
numFrames = 64,
sheetContentWidth = 1024,
sheetContentHeight = 1024,
}
local thunderSheet = graphics.newImageSheet ( “images/battleAttacks/thunderSheet.png” ,thunderOptions )
local sequenceData = {
– thunder ball
{ name = “thunderBall” ,sheet=thunderSheet ,frames = {1,2,3,4,5,6,5,4,5,6},loopCount = 1 ,time = 500 },
– thunder from sky
{ name = “thunderFromSky” ,sheet=thunderSheet ,frames = {10,11} ,time = 100 },
}
[/lua]
Is just by doing the code above, means that the sheet is already loaded to memory?
Then when im using this sheet I do :
[lua]local thunderFromSky = display.newSprite( thunderSheet, sequenceData )[/lua]
Hopefully only after this line of code the sheet is actually loaded.
One more question at the subject, is there a way to print to console the memory usage?
Currently im making a build and using instruments but its a lot of hassle.
Roy.