"use strict";
cc._RF.push(module, '044272emnRLGacv4H91ZXLp', 'guide');
// Script/guide.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Guide = /** @class */ (function (_super) {
    __extends(Guide, _super);
    function Guide() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * 显示遮罩
    */
    Guide.prototype.showMask = function (target, spriteFrame) {
        var _this = this;
        this.node.setPosition(cc.v2(target.x, target.y));
        this.node.parent = target.parent;
        cc.loader.loadRes(spriteFrame, cc.SpriteFrame, function (err, spFrame) {
            if (err) {
                console.log(err);
                return;
            }
            _this.node.getComponent(cc.Mask).spriteFrame = spFrame;
            _this.node.setContentSize(cc.size(target.width, target.height));
        });
        var blockLayer = this.node.getChildByName("block");
        var blockPos = blockLayer.convertToNodeSpace(cc.v2(0, 0));
        blockLayer.setPosition(cc.v2(blockPos.x, blockPos.y));
    };
    Guide.prototype.hideMask = function () {
        if (this.node.active)
            this.node.active = false;
    };
    Guide = __decorate([
        ccclass
    ], Guide);
    return Guide;
}(cc.Component));
exports.default = Guide;

cc._RF.pop();