hello…
How can I insert a mask in a new group?
I have tiles for an isometric game.
I use a mask for a grass tile, and I can see the “little” grass on top
but as soon as I insert the tile in a new group
I can not see the “little” grass on top of the tile
the mask is not working…
This is the code
local maskGrass1 = graphics.newMask( "images/maskGrass1.png" ) --\< THE MASK local tiles = {} function createBoard1() for i = 1, 20 do for j = 1, 20 do local aTile = display.newImageRect(sceneGroup, "images/grass1.png", 128, 64 ) tiles[i] = aTile -- For efficient instead of multiple lookups. aTile:setMask( maskGrass1 ) floorGroup1:insert( aTile ) -- \<-- RIGHT HERE IS THE GROUP aTile.isHitTestMasked = true aTile.x = 128\*(i-1) aTile.y = 64\*(j-1) aTile.myID = (i-1) \* 20 + j -- not sure where your ids are coming from, so I did this aTile.touch = onTouch aTile:addEventListener( "touch" ) end end end
I appreciate your help
Victor