In my cocos2d iPhone application, I want to display a large image (3000 x 4000 px) which I frequently update. But on 1st, 2nd and 3rd gen devices, I can only load textures up to 1024 px width and on the iPhone 4 2048 px. Is there a way to split the texture up?
Thanks in advance!
Displaying a large image?
(7 posts) (4 voices)-
Posted 1 year ago #
-
I actually have the same problem and manually i'm using PS to crop the large images in 1000x1000 png's with 1px transparent margin to ensure that we don't have lines in runtime.
I have a automatic "ACTION" in PS to do this i love to know if there is a better way
Posted 1 year ago # -
But I can't do this in PS because I want to display an image from my server that automatically updates.
Posted 1 year ago # -
In that case you'll have to make use of the image processing libraries on your server to split the image into pieces. In PHP for instance you can use GD for that.
Posted 1 year ago # -
You're going to have to tile it (like google maps), it may also help reduce some of the load on the server.
Posted 1 year ago # -
I think that's the way Apple uses Google maps. I think I'll try GD.
Posted 1 year ago # -
Session 104 Developing apps with scroll views from WWDC2010 has a nice summary of doing this sort of tiled approach in UIKit, accessible from developer.apple.com. A similar approach could be put together in cocos2d.
Posted 1 year ago #
Reply
You must log in to post.