import { Container } from "./container"; import { AdvancedDynamicTexture } from "../advancedDynamicTexture"; import { ValueAndUnit } from "../valueAndUnit"; import { Nullable, Observer, Vector2, AbstractMesh, Observable, Vector3, Scene, Tools, Matrix, PointerEventTypes } from "babylonjs"; 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 { private _alpha = 1; private _alphaSet = false; private _zIndex = 0; /** @hidden */ public _root: Nullable; /** @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