About Max sprite sheet size

Hi guys, I know that the max sprite sheet size is limited, 1024x1024 for older iphone, 2048x2048 for iphone4 and 5.

But here is some thing interesting:
I load a sprite sheet about 4000x6000, each frame is about 300x400. This is way over sized, but it is working on iphone 4 and iphone 5 !?
It took away about 100 mb texture memory.

So how come it is working?
And if I really need a sprite that big, what would be the best way to do so? (memory friendly)

Thanks [import]uid: 81853 topic_id: 33738 reply_id: 333738[/import]

Hi Dan,
Did you try printing the device’s max texture size to the screen? You’ll need to test this as an actual text object on the screen using the device, not just a “print” to the Terminal or mere testing in the Simulator.

system.getInfo( "maxTextureSize" )

Try that and please report what value(s) you’re seeing.

Thanks,
Brent [import]uid: 200026 topic_id: 33738 reply_id: 134199[/import]

Hello again,
I researched this and I have a better answer for you. :slight_smile:

If the image you are trying to load is larger than the max texture size, Corona will automatically downscale it to fit the max texture size before loading it into OpenGL. Corona does this on all platforms (Mac, Windows, iOS, and Android). This “feature” is especially needed when loading photos from the photo gallery which are almost always larger than the max texture size allowed.

However, this downscaling doesn’t occur with text (display.newText() objects). These objects are converted into bitmaps upon rendering to the screen. If you exceed the maximum texture size, i.e. if you use enormous fonts or huge string lengths that exceed the texture width limit, you end up with black rectangles on the screen.

Hope this helps!
Brent [import]uid: 200026 topic_id: 33738 reply_id: 134247[/import]

Hi Dan,
Did you try printing the device’s max texture size to the screen? You’ll need to test this as an actual text object on the screen using the device, not just a “print” to the Terminal or mere testing in the Simulator.

system.getInfo( "maxTextureSize" )

Try that and please report what value(s) you’re seeing.

Thanks,
Brent [import]uid: 200026 topic_id: 33738 reply_id: 134199[/import]

Hello again,
I researched this and I have a better answer for you. :slight_smile:

If the image you are trying to load is larger than the max texture size, Corona will automatically downscale it to fit the max texture size before loading it into OpenGL. Corona does this on all platforms (Mac, Windows, iOS, and Android). This “feature” is especially needed when loading photos from the photo gallery which are almost always larger than the max texture size allowed.

However, this downscaling doesn’t occur with text (display.newText() objects). These objects are converted into bitmaps upon rendering to the screen. If you exceed the maximum texture size, i.e. if you use enormous fonts or huge string lengths that exceed the texture width limit, you end up with black rectangles on the screen.

Hope this helps!
Brent [import]uid: 200026 topic_id: 33738 reply_id: 134247[/import]