我在一个
ClippingNode上面用
DrawNode当Stencil Node。现在在DrawNode上面调用
drawDot函数,参数见代码。
为啥我得到的却是一个方块???难道不应该是一个实心圆么?
话说我怎么才能得到一个实心圆呢?
生成ClipLayer的时候传进去一个Sprite当内容。
local ClipLayer = class("ClipLayer", function()
return display.newLayer()
end)
function ClipLayer:ctor(aContent)
local drawPanel = cc.DrawNode:create()
local clip = cc.ClippingNode:create(drawPanel)
:addTo(self)
:addChild(aContent)
self:setTouchEnabled(true)
self:addNodeEventListener(cc.NODE_TOUCH_EVENT, function(event)
local center = cc.p(event.x, event.y)
drawPanel:drawDot(
center,
100,
cc.c4b(0, 0, 0, 255))
return true
end)
end
return ClipLayer
