animation didin't appear at devices

hello guys, i have a problem with my apps

my app has a many animation made with flash, so i used animo to export it to lua

the problem is some of my animation didn’t appear at devices, but it’s okay on simulator

my suspect is the animation which didn’t appear has 4096 width on the png file, is that the cause?
[import]uid: 164509 topic_id: 33556 reply_id: 333556[/import]

That is very likely the problem. Depending on the device and operating system, you may be limited to 1024px or 2048px texture files.

You can add this to your code:

print( system.getInfo(“maxTextureSize”) )

Then look at the console log on the device and find out the limits you need to deal with. Also keep in mind performance too. This chart is quite telling:

512x512 image = 1mb memory
1024x1024 image = 4mb memory
2048x2048 image = 16mb memory
4096x4096 image = 64mb of memory

Try to run that on an iPad 1 or iPhone 3Gs with 256mb of memory (of which you don’t get all of!) you can see that 4096x4096 is going to run out of memory in a real hurry on those devices.
[import]uid: 199310 topic_id: 33556 reply_id: 133374[/import]

yeaah and that’s really the cause, beecause when i made below 4096 it’s work perfectly

so any other alternative for my case?
i’ll try to separate into two animations, but i don’t know how to make it continue and loop

anyway here’s the snippet of my code

 if xDistance \> 50 or yDistance \> 50 then   
 if xDistance \> yDistance then  
 if beginX \> endX then  
 if(pos~=i-1) then   
 spriteFactory:dispose()  
 loqsprite = require('loq\_sprite')  
 pos=pos+1  
 print(out[pos])  
 spriteFactory = loqsprite.newFactory(out[pos])  
 anim = spriteFactory:newSpriteGroup()  
 anim.x = 0  
 anim.y = 0  
 anim:play()  
 end  
 else   
 if(pos~=1) then  
 spriteFactory:dispose()  
 loqsprite = require('loq\_sprite')   
 pos=pos-1  
 print(out[pos])  
 spriteFactory = loqsprite.newFactory(out[pos])  
 anim = spriteFactory:newSpriteGroup()  
 anim.x = 0  
 anim.y = 0  
 anim:play()  
 end  
 end  
 end  
end  

i get the path from database and store it to array so out[pos] is refer to variable out which stored the path of sheet [import]uid: 164509 topic_id: 33556 reply_id: 133440[/import]

That is very likely the problem. Depending on the device and operating system, you may be limited to 1024px or 2048px texture files.

You can add this to your code:

print( system.getInfo(“maxTextureSize”) )

Then look at the console log on the device and find out the limits you need to deal with. Also keep in mind performance too. This chart is quite telling:

512x512 image = 1mb memory
1024x1024 image = 4mb memory
2048x2048 image = 16mb memory
4096x4096 image = 64mb of memory

Try to run that on an iPad 1 or iPhone 3Gs with 256mb of memory (of which you don’t get all of!) you can see that 4096x4096 is going to run out of memory in a real hurry on those devices.
[import]uid: 199310 topic_id: 33556 reply_id: 133374[/import]

yeaah and that’s really the cause, beecause when i made below 4096 it’s work perfectly

so any other alternative for my case?
i’ll try to separate into two animations, but i don’t know how to make it continue and loop

anyway here’s the snippet of my code

 if xDistance \> 50 or yDistance \> 50 then   
 if xDistance \> yDistance then  
 if beginX \> endX then  
 if(pos~=i-1) then   
 spriteFactory:dispose()  
 loqsprite = require('loq\_sprite')  
 pos=pos+1  
 print(out[pos])  
 spriteFactory = loqsprite.newFactory(out[pos])  
 anim = spriteFactory:newSpriteGroup()  
 anim.x = 0  
 anim.y = 0  
 anim:play()  
 end  
 else   
 if(pos~=1) then  
 spriteFactory:dispose()  
 loqsprite = require('loq\_sprite')   
 pos=pos-1  
 print(out[pos])  
 spriteFactory = loqsprite.newFactory(out[pos])  
 anim = spriteFactory:newSpriteGroup()  
 anim.x = 0  
 anim.y = 0  
 anim:play()  
 end  
 end  
 end  
end  

i get the path from database and store it to array so out[pos] is refer to variable out which stored the path of sheet [import]uid: 164509 topic_id: 33556 reply_id: 133440[/import]