Need pointers - dragging a background larger than the screen

Hi all,

I’ve been looking at the starting examples, and while I swear I think I saw an example somewhere, I haven’t been able to come back across it.

I want to be able to zoom and scroll a background image much in the same way as one would scroll a zoomed-in picture on the iPhone or other smart phones. Scrolling would have maximum boundaries so that the edges of the picture never cross the frame of the display. (Whether firm or spring-loaded edges when reaching the boundary, I’m not picky.)

I’ve seen scroll views for text and fixed objects, and I’ve seen the slide view for scrolling between set images, but I haven’t been able to locate a demo of this functionality yet.

Any sample code pointers in the right direction would be much appreciated.

Thanks!
-Kel [import]uid: 97464 topic_id: 16915 reply_id: 316915[/import]

I think what you’re looking for is probably this; http://developer.anscamobile.com/code/parallax-scrolling-module [import]uid: 52491 topic_id: 16915 reply_id: 63741[/import]

Thanks for the response, Peach!

The Parallax example from your link looks great for a side-scrolling game (ala Mario or Megaman).

I should have given a clearer example, sorry. I’m looking to build a draggable background somewhat similar to Words Wirh Friends. I need tone able to zoom in and out, and drag the background image around in a very similar fashion to the WWF mechanics. I’m not working on a wordplay game, but this UI style is exactly what I need to achieve.

I’m starting to play around with trying to achieve it in code, but so far I don’t have anything approaching success.

Thanks again! [import]uid: 97464 topic_id: 16915 reply_id: 63835[/import]

Can I suggest you look at the dragging parts of the parallax example in order to understand dragging/boundaries, then check out this; http://developer.anscamobile.com/content/pinch-zoom-gesture for the actual zooming?

I haven’t played Words With Friends (terrible, I know) so I’m afraid I don’t know exactly what you’re after but from the sounds of things the above might help.

Peach :slight_smile: [import]uid: 52491 topic_id: 16915 reply_id: 63965[/import]