Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

在手机浏览器上面Graphics画线,有问题啊!

$
0
0

@kubixiake 写道:

效果如上面!代码
drawGrid:function(node,width,height,col,row,lineColor){
var g=node.getComponent(cc.Graphics)
g.clear();
var colSpacing =width/col;
var rowSpacing=height/row;

    for (var i=0;i<col+1;i++){
        g.strokeColor = lineColor;
        g.fillColor  = lineColor;
        g.moveTo(i*colSpacing,0);
        g.lineTo(i*colSpacing,-height);
        g.stroke();
    }
    for (var i=0;i<row+1;i++){
        g.strokeColor = lineColor;
        g.fillColor  = lineColor;
        g.moveTo(0,-i* rowSpacing);
        g.lineTo(width,-i* rowSpacing);
        g.stroke();
    }
}

在PC浏览器上面没问题!

帖子: 6

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>