'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var deprecation = require('../../utils/logging/deprecation.js');
var Container = require('../scene/Container.js');
var TextView = require('./TextView.js');

class Text extends Container.Container {
  constructor(...args) {
    let options = args[0];
    if (typeof options === "string" || args[1]) {
      deprecation.deprecation(deprecation.v8_0_0, 'use new Text({ text: "hi!", style }) instead');
      options = {
        text: options,
        style: args[1]
      };
    }
    super({
      view: new TextView.TextView(options),
      label: "Text",
      ...options
    });
    this.allowChildren = false;
  }
  get anchor() {
    return this.view.anchor;
  }
  set anchor(value) {
    this.view.anchor.x = value.x;
    this.view.anchor.y = value.y;
  }
  set text(value) {
    this.view.text = value;
  }
  get text() {
    return this.view.text;
  }
  set style(value) {
    this.view.style = value;
  }
  get style() {
    return this.view.style;
  }
}
class BitmapText extends Text {
  constructor(...args) {
    deprecation.deprecation(deprecation.v8_0_0, 'use new Text({ text: "hi!", style, renderMode: "bitmap" }) instead');
    let options = args[0];
    if (typeof options === "string" || args[1]) {
      options = {
        text: options,
        style: args[1]
      };
    }
    options.renderMode = "bitmap";
    super(options);
  }
}
class HTMLText extends Text {
  constructor(...args) {
    deprecation.deprecation(deprecation.v8_0_0, 'use new Text({ text: "hi!", style, renderMode: "html" }) instead');
    let options = args[0];
    if (typeof options === "string" || args[1]) {
      options = {
        text: options,
        style: args[1]
      };
    }
    options.renderMode = "html";
    super(options);
  }
}

exports.BitmapText = BitmapText;
exports.HTMLText = HTMLText;
exports.Text = Text;
//# sourceMappingURL=Text.js.map
