I’ve struggled for about 4 hours or so, now I’m whacked…
Could anyone help, please?
I have two display.newGroup() objects:
-local scene = display.newGroup()
-local allSceneElements = display.newGroup()
First one holds scene elements on which the hero can walk (map, trees,…).
The second one holds ALL elements on screen. It’s for “shaking”/sliding/breathing the environment, to have some motion while nothing happens.
Now I want to be able to Drag the allSceneElements around, in terms to explore the whole Level. I’ve tried endless combinations and possibilities I’m aware of, but, no success. After cleaning all shit out again, I have the fallowing code so far…
[lua]-- grabbing and exploring Scene
local container = display.newGroup()
container:insert(allSceneElements)
local function SceneExplore( event )
if event.phase == “moved” then
container.x = event.x
container.y = event.y
end
end
Runtime:addEventListener( “touch”, SceneExplore )[/lua]
I’ve added a third display.newGroup() which acts as a container - otherwise I wasn’t able to interact with it at all.
How can I accomplish my task in a good manner?
PS: By the way, there is an image inside “scene” Group, which is actually my map. It’s 2470×1940px large. [import]uid: 73502 topic_id: 18104 reply_id: 318104[/import]
[import]uid: 52491 topic_id: 18104 reply_id: 69280[/import]