سؤال

I'm trying to develop for Android, using Lua and Corona Simulator. The maximum image size that Android accepts is 2048x2048 pixels. I currently have an imagesheet that's 148 pixels high and 4690 pixels wide. The sheet consists of 35 images on a single line. Is there a way I can break this imagesheet up in multiple lines of frames and still use the Simple animation method listed here (http://docs.coronalabs.com/api/library/graphics/newImageSheet.html) rather than the complex one, or do I really have to declare each frame individually?

I have tried scaling the image down to a width of 1995 pixels, and then scaling it back up inside the program, but this (obviously) resulted in terrible resolution. I also tried (although this was with another image that presented the same issue) breaking the image up into two lines, so it was twice as high and half as wide, but I couldn't get this to work with the Simple method in Corona I mentioned above. The Complex method seems like a last resort, because it's a ton of work and code declaring each frame in the imagesheet individually by x, y, width and height.

هل كانت مفيدة؟

المحلول

The sequence navigates your texture image from left to right, top to bottom. So use a 5x7 grid of sub-images (5 rows, 7 columns, instead of 1 row, 35 columns), sequenced in this manner. Your image would then be 740 x 938.

Alternately, you could have multiple image sheets and switch between them as required.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top