问下大家个小问题

我new了一个drawline 是连连看的那种线 出现后我需要他消失,fadeout不了 不知道怎么渐隐这个line,求各位大大教下

drawline是不支持fadeout, 如果想要做渐隐效果,可以手动循环创建不同透明度的line,具体式样如下代码。

local scheduler = require(“framework.scheduler”)
self._points = {{display.cx, display.cy}, {display.cx + 100, display.cy}}
self._color = cc.c4f(1.0, 0.0, 0.0, 1.0)
self._line = display.newLine(self._points, {borderColor = self._color, borderWidth = 4})
self:addChild(self._line, 100)
local handle = nil
handle = scheduler.scheduleGlobal(function()
if self._line ~= nil then
self._line:removeFromParent()
self._line = nil
end

    self._color.a = self._color.a - 0.05
    if self._color.a > 0 then
        self._line = display.newLine(self._points, {borderColor = self._color, borderWidth = 4})
        self:addChild(self._line, 100)
    else
        scheduler.unscheduleGlobal(handle)
    end
end, 0.05)

谢谢版主,解答了我的疑问

我觉得 这种东西 还是美术出图比较靠谱 九宫格的拉伸就行。。。