[]如何清除graphics绘制的矢量图


            let count1 = 1;
            Laya.timer.loop(3000, this, function () {
                sp.graphics.clear();
                if (count1 == 0) {
                    sp.graphics.drawLines(0, 0, path, "#0eff00", 5);
                } else if (count1 == 1) {
                    sp.graphics.drawLines(0, 0, path1, "#0eff00", 5);
                } else if (count1 == 2) {
                    sp.graphics.drawLines(0, 0, path2, "#0eff00", 5);
                } else if (count1 == 3) {
                    sp.graphics.drawLines(0, 0, path3, "#0eff00", 5);
                    count1 = -1;
                }
                console.log(count1);    
                count1++;
            }); 
上面的sp.graphics.clear()不起作用
已邀请:

Monica - 知识达人

赞同来自: zjkynu

我这边测试没有问题,你再检查下你的代码吧...
还是不可以清理掉的话麻烦上传一个有问题的例子,我们看下!

要回复问题请先

商务合作
商务合作