Inserting a Mask in a newGroup

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 &nbsp; &nbsp; local tiles = {} function createBoard1()&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; for i = 1, 20 do&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j = 1, 20 do &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local aTile = display.newImageRect(sceneGroup, "images/grass1.png", 128, 64 ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tiles[i] = aTile -- For efficient instead of multiple lookups. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aTile:setMask( maskGrass1 ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; floorGroup1:insert( aTile ) -- \<-- RIGHT HERE IS THE GROUP &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aTile.isHitTestMasked = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aTile.x = 128\*(i-1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aTile.y = 64\*(j-1) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aTile.myID = (i-1) \* 20 + j -- not sure where your ids are coming from, so I did this &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aTile.touch = onTouch &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aTile:addEventListener( "touch" ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; end end

I appreciate your help

Victor

The mask should not need to be inserted as it’s own image, it’s kind of joined with the image that you applied it too.

Rob

Okay Rob. I got it. Thanks.

The mask should not need to be inserted as it’s own image, it’s kind of joined with the image that you applied it too.

Rob

Okay Rob. I got it. Thanks.