Hello.
I’m working on this code since yesterday, and I do not understand why the first code works
Using mask file !
local cntWidth = display.contentWidth
local cntHeight = display.contentHeight
local cntX = display.contentCenterX
local cntY = display.contentCenterY
local oOver = display.newImage("world2.jpg", cntWidth, cntHeight)
oOver.x, oOver.y = cntX, cntY
local oMaskImg = graphics.newMask("telemask.png")
oOver:setMask(oMaskImg)
oOver.maskX = 0
oOver.maskY = 0
But this one, using dynamic Mask doesn’t works !
local cntWidth = display.contentWidth
local cntHeight = display.contentHeight
local cntX = display.contentCenterX
local cntY = display.contentCenterY
local oOver = display.newImage("world2.jpg", cntWidth, cntHeight)
oOver.x, oOver.y = cntX, cntY
local oTexture = graphics.newTexture{ type = "maskCanvas", width = 128, height = 128 }
oTexture:setBackground(0, 0, 0)
local b = display.newCircle(0, 0, 64)
b:setFillColor(1)
oTexture:draw(b)
local o = display.newCircle(0, 0, 32)
o:setFillColor(0)
oTexture:draw(o)
oTexture:invalidate()
local oMask = graphics.newMask(oTexture.filename, oTexture.baseDir)
oOver:setMask(oMask)
oOver.maskX = 0
oOver.maskY = 0
It look’s like there is a full black mask !
A little help before I become cray
Thank’s