import { Nullable } from "babylonjs/types"; import { Observable, Observer } from "babylonjs/Misc/observable"; import { Vector2, Vector3, Matrix } from "babylonjs/Maths/math"; import { PointerEventTypes } from 'babylonjs/Events/pointerEvents'; import { Logger } from "babylonjs/Misc/logger"; import { Tools } from "babylonjs/Misc/tools"; import { AbstractMesh } from "babylonjs/Meshes/abstractMesh"; import { Scene } from "babylonjs/scene"; import { Container } from "./container"; import { AdvancedDynamicTexture } from "../advancedDynamicTexture"; import { ValueAndUnit } from "../valueAndUnit"; import { Measure } from "../measure"; import { Style } from "../style"; import { Matrix2D, Vector2WithInfo } from "../math2D"; /** * Root class used for all 2D controls * @see http://doc.babylonjs.com/how_to/gui#controls */ export class Control { /** * Gets or sets a boolean indicating if alpha must be an inherited value (false by default) */ public static AllowAlphaInheritance = false; private _alpha = 1; private _alphaSet = false; private _zIndex = 0; /** @hidden */ public _host: AdvancedDynamicTexture; /** Gets or sets the control parent */ public parent: Nullable; /** @hidden */ public _currentMeasure = Measure.Empty(); private _fontFamily = "Arial"; private _fontStyle = ""; private _fontWeight = ""; private _fontSize = new ValueAndUnit(18, ValueAndUnit.UNITMODE_PIXEL, false); private _font: string; /** @hidden */ public _width = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false); /** @hidden */ public _height = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false); /** @hidden */ protected _fontOffset: { ascent: number, height: number, descent: number }; private _color = ""; private _style: Nullable