(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/scripts/Brush.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '410e3WzTGxIC4iHpxkqMQBL', 'Brush', __filename);
// 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();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=Brush.js.map
        