Thanks to whoever is watching this for taking some of his/her time to help me out.
Here’s the thing, I want to drag a tile(a tree tile from the IsometricAndPlayer sample), but it does not drag the tile(or at least doesnt drags the tree), it just kind of like presses the tiles Im dragging it to, but not the tile.
--screenToGrid is a function that takes a screen position, transforms it to a world position and then to a grid position
local startGridPos = screenToGridPosition(event)
--getTileFromScreen is a function that takes a screen OR grid position and returns the tile at that position
local tile = getTileFromScreen(startGridPos)
if not tile then
--alert() its like native.showAlert(), just made simpler and similar to the JS alert() call
alert('Tile == NIL before event.phases')
end
if event.phase == 'began' then
if tile then
--sets the starting tile image to the tree tile
tile:setImage(1)
end
elseif event.phase == 'moved' then
if tile then
--Attempting to drag it
tile:drag( event )
else
alert('No tile Object')
end
elseif event.phase == 'ended' then
--Getting the tile from the ending position
--local tmpTile = getTileFromScreen(event)
--Setting the image to the tree tile
--if tmpTile then
-- tmpTile:setImage(1)
--end
end
I dont know if I explained myself correctly. Thanks again! [import]uid: 109816 topic_id: 19213 reply_id: 319213[/import]