How to scroll a large image

I’m a newbie to Corona and have a simple question. I have a large image that I want to the user to be able to scroll and pan around to see the rest of the image. I’ve looked around the site but didn’t see how to do this.

Thanks! [import]uid: 55034 topic_id: 9273 reply_id: 309273[/import]

You can “scroll” (move) an image by changing its position coordinates or start a transition.to function. For sliding an image via the touch of your finger I suggest you look at one of the example scripts. It shows that exactly. [import]uid: 5712 topic_id: 9273 reply_id: 33853[/import]

Specifically, download the Ghost vs Monsters code. The touch eventListener is very bloated for your purposes but it is extremely useful.
After you do some thinking and striping down the code you get.
[lua]local mrSwipie = function( event )
local target = event.target
local phase = event.phase
if phase == “began” then
–set up some variables like storing the origin x(target.x0) and y
elseif phase == “moved” then
–move the stage here like
target.x = event.x
target.y = event.y
–but you might need some math like event.x - target.x0
–like in the Ghost vs Monsters game
elseif phase == “ended” then
–if you want you can use translate.to() here
– and do some other stuff
end
end[/lua]
I do not suggest using translate.to() in the “moved” section since 1)I heard it isn’t really efficient when used to the the extent of something like swiping where you will 2)be calling it hundreds(exaggerating) of times whenever your user decides to swipe. So it is best to use something simple like: [lua]target.x = target.x + distanceChangeInTouch[/lua] It is okay to use transition.to() in the “ended” section. If you need more help than that let me know. [import]uid: 54716 topic_id: 9273 reply_id: 33859[/import]

Thank you ir8primates, MikeHart. I will try your suggestions. [import]uid: 55034 topic_id: 9273 reply_id: 33887[/import]