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 Talk = (function (_super) {
    __extends(Talk, _super);
    function Talk() {
        var _this = _super.call(this) || this;
        _this.skinName = "TalkSkin";
        _this.percentWidth = 100;
        _this.percentHeight = 100;
        return _this;
    }
    Talk.prototype.childrenCreated = function () {
        _super.prototype.childrenCreated.call(this);
        this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClickHandler, this);
    };
    Talk.prototype.onClickHandler = function (e) {
        this.visible = false;
        if (this.call) {
            this.call();
        }
    };
    Talk.prototype.setTalk = function (msg, call) {
        this.text.text = msg + "\n";
        this.call = call;
        this.bg.scaleX = this.bg.scaleY = 1;
        this.bg.width = this.text.width + 20;
        this.bg.height = this.text.height + 20;
        this.bg.y = this.height / 2 - this.bg.height / 2;
        this.bg.x = this.width / 2 - this.bg.width / 2;
        this.text.y = this.bg.y + 10;
        this.text.x = this.bg.x + 10;
        this.visible = true;
    };
    return Talk;
}(eui.Component));
__reflect(Talk.prototype, "Talk");
var talk;
//# sourceMappingURL=Talk.js.map