Dragging a display group on an isometric map

I was just wondering if it’s possible to drag a display group on an isometric map( being able to keep dragging a single tile ). I’ve tried in some ways, without success. I imagine it’s possible, but I thought about asking here first, so I dont work through a really long and hard path just to find out it was a lot simpler.

So I was thinking something like this:

--...  
local startGridPos = nil  
local onMapClick = function( event )  
 if not startGridPos then  
 startGridPos = \_functions.screenToGridPosition(event)  
 end  
  
 local tile = \_functions.getTileFromScreen(startGridPos)  
 tileGid = tile.gid  
  
 tile:drag( event )  
 tile:getVisual():toFront()  
  
 if event.phase == 'began' then  
  
 if tile then  
  
 local gidImg = \_functions.\_gidImage(tileGid)  
  
 --Get the tile image gid and check if the tile is a grass tile(equivalent to an empty tile)  
 if \_functions.\_isGrassTile(tileGid) then  
 --It would continue the rest of the onMapClick function normally(changing the image gid to an tree and dragging it or something like that) and inserting the tile to the display group  
 else  
 --tileGroup is the display group previously defined  
 tileGroup:drag( event )  
 end  
  
end  
  
Runtime::addEventListener("touch", onMapClick)  
  

I dont know if I explained my point correctly. Hope that I did, I can post more code if needed, thank you before hand for even checking this post to help :slight_smile: [import]uid: 109816 topic_id: 19550 reply_id: 319550[/import]

There seems to be a few errors in that code, have you just typed it here or are you using it and getting errors? [import]uid: 5833 topic_id: 19550 reply_id: 76199[/import]

The code gives me no errors. I skipped the declaration of some vars( and besides, I typed it manually). Im using it now(with a few modifications, but no errors). The thing is, that it’s not working. I mean, it doesnt give errors, but it doesn’t do what I want it to do, which is to drag a display group as if it were one big tile. And I was wondering if there’s a way to accomplish that.

Sorry for the untimely answer, I thought I had checked if someone had answered it yesterday, but apparently I was mistaken.

Thanks again man, you’re the bomb! :stuck_out_tongue: [import]uid: 109816 topic_id: 19550 reply_id: 76458[/import]

Dont worry now though, we decided not to use the isometric map, as it is apparently in Beta mode, and it’s harder and apparently more limited than the orthogonal. Thank you though, you have been really valuable and good with me. I appreciate it. Happy New Year! [import]uid: 109816 topic_id: 19550 reply_id: 76479[/import]