UNPKG

lingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

32 lines 928 B
import Appendable from "../display/core/Appendable"; import { uiContainer } from "../engine/renderLoop/containers"; import { textDefaults, textSchema } from "../interface/IText"; import createElement from "../utils/createElement"; class Text extends Appendable { static componentName = "text"; static defaults = textDefaults; static schema = textSchema; el = createElement(`<div style="opacity: 1">text</div>`); constructor() { super(); uiContainer.appendChild(this.el); } disposeNode() { super.disposeNode(); this.el.remove(); } get opacity() { return Number(this.el.style.opacity); } set opacity(value) { this.el.style.opacity = value + ""; } get value() { return this.el.textContent ?? ""; } set value(value) { this.el.textContent = value; } } export default Text; //# sourceMappingURL=Text.js.map