map dragging and scaling

Hi,

I’m a newbie, I’ve been having a few little issues when it comes to scaling the map and then being able to use drag, or focus, or touch->map translations correctly which is turning into a pain.

to get around the drag issue i do something like the following inside the basic touch handlers before passing it on:
[blockcode]
local scale = map:getScale()
if (event.rescaled == nil) then
if (scale == 1) then
– no scaling required
else
event.x = ((event.x - event.xStart) / scale) + (event.xStart / scale)
event.y = ((event.y - event.yStart) / scale) + (event.yStart / scale)
event.xStart = event.xStart / scale
event.yStart = event.yStart / scale
end
event.rescaled = true;
end

map:drag(event)
[/blockcode]
but it appears not so easy when trying to use map:setFocus(somemovingobject) as I can’t really keep translating the xy positions every frame… [import]uid: 80828 topic_id: 16426 reply_id: 316426[/import]

I will try to get a fix in for this issue ASAP. If possible could you send a simple project just showing off the problem so that I can easily reproduce it my end.

Email is: support AT justaddli DOT me [import]uid: 5833 topic_id: 16426 reply_id: 61820[/import]

sorry for the delay - the easy way to reproduce is just to add
map:scale(0.5,nil)

to the end of main.lua in your basicrpgmovement sample

that pretty much shows all the issues.

thanks for your quick response

Dave [import]uid: 80828 topic_id: 16426 reply_id: 62289[/import]

I hope to have it fixed for the next version :slight_smile: [import]uid: 5833 topic_id: 16426 reply_id: 64274[/import]