CocosCreator 2.4.0
// 测试代码:
let debugNode = new cc.Node()
this.node.addChild(debugNode)
debugNode.addComponent(cc.Graphics)
let graphics = debugNode.getComponent(cc.Graphics)
graphics.fillColor = new cc.Color(20, 20, 20, 100)
for (let y = 0; y < 100; y++) {
for (let x = 0; x < 180; x++) {
graphics.fillRect(x*20, y*20, 10, 10)
}
}