I am trying to create a puzzle game. I successfully created a prototype using my image assets from my iOS native version. It works great across all devices in the simulator but because I chose to only use iPad 3 resolution assets (to keep the best image quality and avoid having to code every resolution by hand) I am using 29.4MB texture ram regardless of device.
I am looking at optimizing this, and ideally use assets for each device without having to code everything by hand. I started playing around with image sheets, and dramatically decreased the amount of memory required, but ran into some issues.
The way I initially made my prototype is to create a table with the piece name (used to map to the correct file), the image dimensions, and the correct X/Y position for when the piece should “lock”. I have a display rectangle as my furthest background, this gives the canvas a color. I then loaded my “map” file that shows the outline of the puzzle and each piece (it is not a jigsaw, but shapes). This was a B&W transparent PNG file (2048x1536). I already have all the image assets in 4 resolutions and all the x/y coordinates from the iOS version of the game. If I use TopLeftRefererencePoint, everything lines up perfectly.
When using ImageSheets, the first thing I did was to load the map to fill the screen. I am using _W, _H for the size. When I do this, it does not fit the same way it did as an image. Because the transparency was removed, it no longer fits properly. I could load this file as a regular image but now I am stuck with a full size image again and I don’t think different sizes will line up correctly unless I use different sizes for everything, then I have to use custom x/y position for the “correct target” spot for each image individually,
Is there a better way to do all this, preferably using the benefits of imageSheets at least for the pieces and optimizing the texture memory without having to figure out x/y position for 4 images for each of the 200+ puzzles and all future ones?
[import]uid: 160288 topic_id: 32544 reply_id: 332544[/import]