var __reflect = (this && this.__reflect) || function (p, c, t) {
    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Letter = (function (_super) {
    __extends(Letter, _super);
    function Letter() {
        var _this = _super.call(this) || this;
        _this.d = {};
        _this.percentWidth = 100;
        _this.percentHeight = 100;
        return _this;
    }
    Letter.prototype.childrenCreated = function () {
        _super.prototype.childrenCreated.call(this);
        this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClickHandler, this);
    };
    Letter.prototype.onClickHandler = function (e) {
        this.visible = false;
    };
    Letter.prototype.setLetter = function (id) {
        var item = RES.getRes("items_json")["items"][id - 1];
        this.d.text = item.content;
        var roleIndex = id - 1;
        // var roleId = roleDefine[roleIndex];
        if (this.qrCode && this.qrCode.parent) {
            this.qrCode.parent.removeChild(this.qrCode);
        }
        var url = Game.instance.gameURL + "?rid=" + roleIndex;
        this.qrCode = qr.QRCode.create(url);
        console.log(url);
        this.qrCode.x = this.width / 2;
        this.qrCode.y = this.height / 2;
        this.addChild(this.qrCode);
        this.visible = true;
    };
    return Letter;
}(eui.Component));
__reflect(Letter.prototype, "Letter", ["eui.UIComponent", "egret.DisplayObject"]);
var letter;
//# sourceMappingURL=Letter.js.map