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]