"use strict";
cc._RF.push(module, '410e3WzTGxIC4iHpxkqMQBL', 'Brush');
// scripts/Brush.js

"use strict";

cc.Class({
    extends: cc.Component,

    properties: {},

    // LIFE-CYCLE CALLBACKS:

    onLoad: function onLoad() {
        this.ctx = this.node.getComponent(cc.Graphics);
    },
    setBrushPos: function setBrushPos(x, y) {
        // 设置画笔起始位置
        this.ctx.moveTo(x, y);
    },
    setBrushLineWidth: function setBrushLineWidth(lineWidth) {
        // 设置画笔粗细
        this.ctx.lineWidth = lineWidth;
    },
    setBrushColor: function setBrushColor(color) {
        // 设置画笔颜色(包括边框颜色和填充颜色)
        this.ctx.strokeColor = color;
        this.ctx.fillColor = color;
    },
    drawTo: function drawTo(x, y) {
        // 从起始位置一直画到目标位置
        this.ctx.lineTo(x, y);
        this.ctx.stroke();
    }

    // update (dt) {},

});

cc._RF.pop();