import { deprecation, v8_0_0 } from '../../utils/logging/deprecation.mjs';
import { Container } from '../scene/Container.mjs';
import { TextView } from './TextView.mjs';

class Text extends Container {
  constructor(...args) {
    let options = args[0];
    if (typeof options === "string" || args[1]) {
      deprecation(v8_0_0, 'use new Text({ text: "hi!", style }) instead');
      options = {
        text: options,
        style: args[1]
      };
    }
    super({
      view: new 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(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(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);
  }
}

export { BitmapText, HTMLText, Text };
//# sourceMappingURL=Text.mjs.map
