It seems mask objects can’t be inserted into display groups. No error message when doing so, but the masked object disappears from the screen. This is true either when the image is inserted into a group before the mask is being applied or after.
I’ve read the thread you refer to --I always search the forum before posting, anyway-- but the problem I encountered isn’t mentioned, there. And since I use a 100 x 100 mask, I don’t have the main issue the thread is about --I’ve seen it when I first explored the mask functionality, tho =)
I’ve downloaded you test project but you don’t use display groups in it. Can you elaborate?
Using the sample project assets you can try this out:
[code]
local container = display.newGroup()
local image = display.newImage(container, ‘nodame.jpg’)
container:setMask(graphics.newMask(‘arrow_gradient_mask.png’)) – mask must be x-aligned on 4 pixels
local function touchHandler(_e)
if _e.phase == ‘moved’ then
container.maskX = _e.x
container.maskY = _e.y
end
end
Turns out the problem was due to a faulty refresh in the Corona simulator --I didn’t try on a real device, then --when putting the masked object in the localGroup used by the infamous Director class =)
It’s now fixed and and it works perfectly fine.
Thanks a lot for your help.
Ch. [import]uid: 4958 topic_id: 8562 reply_id: 30877[/import]