/*Babylon.js GUI*/ // Dependencies for this module: // ../../../../Tools/Gulp/babylonjs // ../../../../Tools/Gulp/2D declare module 'babylonjs-gui' { export * from "babylonjs-gui/2D"; export * from "babylonjs-gui/3D"; } declare module 'babylonjs-gui/2D' { export * from "babylonjs-gui/2D/controls"; export * from "babylonjs-gui/2D/advancedDynamicTexture"; export * from "babylonjs-gui/2D/math2D"; export * from "babylonjs-gui/2D/measure"; export * from "babylonjs-gui/2D/multiLinePoint"; export * from "babylonjs-gui/2D/style"; export * from "babylonjs-gui/2D/valueAndUnit"; } declare module 'babylonjs-gui/3D' { export * from "babylonjs-gui/3D/controls"; export * from "babylonjs-gui/3D/materials"; export * from "babylonjs-gui/3D/gui3DManager"; export * from "babylonjs-gui/3D/vector3WithInfo"; } declare module 'babylonjs-gui/2D/controls' { export * from "babylonjs-gui/2D/controls/button"; export * from "babylonjs-gui/2D/controls/checkbox"; export * from "babylonjs-gui/2D/controls/colorpicker"; export * from "babylonjs-gui/2D/controls/container"; export * from "babylonjs-gui/2D/controls/control"; export * from "babylonjs-gui/2D/controls/ellipse"; export * from "babylonjs-gui/2D/controls/grid"; export * from "babylonjs-gui/2D/controls/image"; export * from "babylonjs-gui/2D/controls/inputText"; export * from "babylonjs-gui/2D/controls/inputPassword"; export * from "babylonjs-gui/2D/controls/line"; export * from "babylonjs-gui/2D/controls/multiLine"; export * from "babylonjs-gui/2D/controls/radioButton"; export * from "babylonjs-gui/2D/controls/stackPanel"; export * from "babylonjs-gui/2D/controls/selector"; export * from "babylonjs-gui/2D/controls/scrollViewers/scrollViewer"; export * from "babylonjs-gui/2D/controls/textBlock"; export * from "babylonjs-gui/2D/controls/virtualKeyboard"; export * from "babylonjs-gui/2D/controls/rectangle"; export * from "babylonjs-gui/2D/controls/displayGrid"; export * from "babylonjs-gui/2D/controls/sliders/baseSlider"; export * from "babylonjs-gui/2D/controls/sliders/slider"; export * from "babylonjs-gui/2D/controls/sliders/imageBasedSlider"; export * from "babylonjs-gui/2D/controls/statics"; } declare module 'babylonjs-gui/2D/advancedDynamicTexture' { import { DynamicTexture, Nullable, Layer, Viewport, Scene, Vector3, Matrix, Vector2, AbstractMesh, Observable, ClipboardInfo } from 'babylonjs'; import { Container } from "babylonjs-gui/2D/controls/container"; import { Control } from "babylonjs-gui/2D/controls/control"; import { Style } from "babylonjs-gui/2D/style"; /** * Interface used to define a control that can receive focus */ export interface IFocusableControl { /** * Function called when the control receives the focus */ onFocus(): void; /** * Function called when the control loses the focus */ onBlur(): void; /** * Function called to let the control handle keyboard events * @param evt defines the current keyboard event */ processKeyboard(evt: KeyboardEvent): void; /** * Function called to get the list of controls that should not steal the focus from this control * @returns an array of controls */ keepsFocusWith(): Nullable; } /** * Class used to create texture to support 2D GUI elements * @see http://doc.babylonjs.com/how_to/gui */ export class AdvancedDynamicTexture extends DynamicTexture { /** @hidden */ _rootContainer: Container; /** @hidden */ _lastPickedControl: Control; /** @hidden */ _lastControlOver: { [pointerId: number]: Control; }; /** @hidden */ _lastControlDown: { [pointerId: number]: Control; }; /** @hidden */ _capturingControl: { [pointerId: number]: Control; }; /** @hidden */ _shouldBlockPointer: boolean; /** @hidden */ _layerToDispose: Nullable; /** @hidden */ _linkedControls: Control[]; /** * Observable event triggered each time an clipboard event is received from the rendering canvas */ onClipboardObservable: Observable; /** * Observable event triggered each time a pointer down is intercepted by a control */ onControlPickedObservable: Observable; /** * Gets or sets a boolean defining if alpha is stored as premultiplied */ premulAlpha: boolean; /** * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger). * Useful when you want more antialiasing */ renderScale: number; /** Gets or sets the background color */ background: string; /** * Gets or sets the ideal width used to design controls. * The GUI will then rescale everything accordingly * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling */ idealWidth: number; /** * Gets or sets the ideal height used to design controls. * The GUI will then rescale everything accordingly * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling */ idealHeight: number; /** * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling */ useSmallestIdeal: boolean; /** * Gets or sets a boolean indicating if adaptive scaling must be used * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling */ renderAtIdealSize: boolean; /** * Gets the underlying layer used to render the texture when in fullscreen mode */ readonly layer: Nullable; /** * Gets the root container control */ readonly rootContainer: Container; /** * Returns an array containing the root container. * This is mostly used to let the Inspector introspects the ADT * @returns an array containing the rootContainer */ getChildren(): Array; /** * Will return all controls that are inside this texture * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored * @return all child controls */ getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[]; /** * Gets or sets the current focused control */ focusedControl: Nullable; /** * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode */ isForeground: boolean; /** * Gets or set information about clipboardData */ clipboardData: string; /** * Creates a new AdvancedDynamicTexture * @param name defines the name of the texture * @param width defines the width of the texture * @param height defines the height of the texture * @param scene defines the hosting scene * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default) * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default) */ constructor(name: string, width: number | undefined, height: number | undefined, scene: Nullable, generateMipMaps?: boolean, samplingMode?: number); /** * Get the current class name of the texture useful for serialization or dynamic coding. * @returns "AdvancedDynamicTexture" */ getClassName(): string; /** * Function used to execute a function on all controls * @param func defines the function to execute * @param container defines the container where controls belong. If null the root container will be used */ executeOnAllControls(func: (control: Control) => void, container?: Container): void; /** * Marks the texture as dirty forcing a complete update */ markAsDirty(): void; /** * Helper function used to create a new style * @returns a new style * @see http://doc.babylonjs.com/how_to/gui#styles */ createStyle(): Style; /** * Adds a new control to the root container * @param control defines the control to add * @returns the current texture */ addControl(control: Control): AdvancedDynamicTexture; /** * Removes a control from the root container * @param control defines the control to remove * @returns the current texture */ removeControl(control: Control): AdvancedDynamicTexture; /** * Release all resources */ dispose(): void; /** @hidden */ _getGlobalViewport(scene: Scene): Viewport; /** * Get screen coordinates for a vector3 * @param position defines the position to project * @param worldMatrix defines the world matrix to use * @returns the projected position */ getProjectedPosition(position: Vector3, worldMatrix: Matrix): Vector2; /** @hidden */ _changeCursor(cursor: string): void; /** @hidden */ _registerLastControlDown(control: Control, pointerId: number): void; /** @hidden */ _cleanControlAfterRemovalFromList(list: { [pointerId: number]: Control; }, control: Control): void; /** @hidden */ _cleanControlAfterRemoval(control: Control): void; /** Attach to all scene events required to support pointer events */ attach(): void; /** * Register the clipboard Events onto the canvas */ registerClipboardEvents(): void; /** * Unregister the clipboard Events from the canvas */ unRegisterClipboardEvents(): void; /** * Connect the texture to a hosting mesh to enable interactions * @param mesh defines the mesh to attach to * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well */ attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void; /** * Move the focus to a specific control * @param control defines the control which will receive the focus */ moveFocusToControl(control: IFocusableControl): void; /** * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) * @param mesh defines the mesh which will receive the texture * @param width defines the texture width (1024 by default) * @param height defines the texture height (1024 by default) * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default) * @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default) * @returns a new AdvancedDynamicTexture */ static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean): AdvancedDynamicTexture; /** * Creates a new AdvancedDynamicTexture in fullscreen mode. * In this mode the texture will rely on a layer for its rendering. * This allows it to be treated like any other layer. * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well. * LayerMask is set through advancedTexture.layer.layerMask * @param name defines name for the texture * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true) * @param scene defines the hsoting scene * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default) * @returns a new AdvancedDynamicTexture */ static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable, sampling?: number): AdvancedDynamicTexture; } } declare module 'babylonjs-gui/2D/math2D' { import { Vector2, Nullable } from "babylonjs"; /** * Class used to transport Vector2 information for pointer events */ export class Vector2WithInfo extends Vector2 { /** defines the current mouse button index */ buttonIndex: number; /** * Creates a new Vector2WithInfo * @param source defines the vector2 data to transport * @param buttonIndex defines the current mouse button index */ constructor(source: Vector2, /** defines the current mouse button index */ buttonIndex?: number); } /** Class used to provide 2D matrix features */ export class Matrix2D { /** Gets the internal array of 6 floats used to store matrix data */ m: Float32Array; /** * Creates a new matrix * @param m00 defines value for (0, 0) * @param m01 defines value for (0, 1) * @param m10 defines value for (1, 0) * @param m11 defines value for (1, 1) * @param m20 defines value for (2, 0) * @param m21 defines value for (2, 1) */ constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number); /** * Fills the matrix from direct values * @param m00 defines value for (0, 0) * @param m01 defines value for (0, 1) * @param m10 defines value for (1, 0) * @param m11 defines value for (1, 1) * @param m20 defines value for (2, 0) * @param m21 defines value for (2, 1) * @returns the current modified matrix */ fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D; /** * Gets matrix determinant * @returns the determinant */ determinant(): number; /** * Inverses the matrix and stores it in a target matrix * @param result defines the target matrix * @returns the current matrix */ invertToRef(result: Matrix2D): Matrix2D; /** * Multiplies the current matrix with another one * @param other defines the second operand * @param result defines the target matrix * @returns the current matrix */ multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D; /** * Applies the current matrix to a set of 2 floats and stores the result in a vector2 * @param x defines the x coordinate to transform * @param y defines the x coordinate to transform * @param result defines the target vector2 * @returns the current matrix */ transformCoordinates(x: number, y: number, result: Vector2): Matrix2D; /** * Creates an identity matrix * @returns a new matrix */ static Identity(): Matrix2D; /** * Creates a translation matrix and stores it in a target matrix * @param x defines the x coordinate of the translation * @param y defines the y coordinate of the translation * @param result defines the target matrix */ static TranslationToRef(x: number, y: number, result: Matrix2D): void; /** * Creates a scaling matrix and stores it in a target matrix * @param x defines the x coordinate of the scaling * @param y defines the y coordinate of the scaling * @param result defines the target matrix */ static ScalingToRef(x: number, y: number, result: Matrix2D): void; /** * Creates a rotation matrix and stores it in a target matrix * @param angle defines the rotation angle * @param result defines the target matrix */ static RotationToRef(angle: number, result: Matrix2D): void; /** * Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix * @param tx defines the x coordinate of the translation * @param ty defines the y coordinate of the translation * @param angle defines the rotation angle * @param scaleX defines the x coordinate of the scaling * @param scaleY defines the y coordinate of the scaling * @param parentMatrix defines the parent matrix to multiply by (can be null) * @param result defines the target matrix */ static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable, result: Matrix2D): void; } } declare module 'babylonjs-gui/2D/measure' { /** * Class used to store 2D control sizes */ export class Measure { /** defines left coordinate */ left: number; /** defines top coordinate */ top: number; /** defines width dimension */ width: number; /** defines height dimension */ height: number; /** * Creates a new measure * @param left defines left coordinate * @param top defines top coordinate * @param width defines width dimension * @param height defines height dimension */ constructor( /** defines left coordinate */ left: number, /** defines top coordinate */ top: number, /** defines width dimension */ width: number, /** defines height dimension */ height: number); /** * Copy from another measure * @param other defines the other measure to copy from */ copyFrom(other: Measure): void; /** * Copy from a group of 4 floats * @param left defines left coordinate * @param top defines top coordinate * @param width defines width dimension * @param height defines height dimension */ copyFromFloats(left: number, top: number, width: number, height: number): void; /** * Check equality between this measure and another one * @param other defines the other measures * @returns true if both measures are equals */ isEqualsTo(other: Measure): boolean; /** * Creates an empty measure * @returns a new measure */ static Empty(): Measure; } } declare module 'babylonjs-gui/2D/multiLinePoint' { import { MultiLine } from "babylonjs-gui/2D/controls/multiLine"; import { Control } from "babylonjs-gui/2D/controls/control"; import { AbstractMesh, Nullable, Vector2 } from "babylonjs"; /** * Class used to store a point for a MultiLine object. * The point can be pure 2D coordinates, a mesh or a control */ export class MultiLinePoint { /** @hidden */ _point: Vector2; /** * Creates a new MultiLinePoint * @param multiLine defines the source MultiLine object */ constructor(multiLine: MultiLine); /** Gets or sets x coordinate */ x: string | number; /** Gets or sets y coordinate */ y: string | number; /** Gets or sets the control associated with this point */ control: Nullable; /** Gets or sets the mesh associated with this point */ mesh: Nullable; /** Resets links */ resetLinks(): void; /** * Gets a translation vector * @returns the translation vector */ translate(): Vector2; /** Release associated resources */ dispose(): void; } } declare module 'babylonjs-gui/2D/style' { import { IDisposable, Observable } from "babylonjs"; import { AdvancedDynamicTexture } from "babylonjs-gui/2D/advancedDynamicTexture"; import { ValueAndUnit } from "babylonjs-gui/2D/valueAndUnit"; /** * Define a style used by control to automatically setup properties based on a template. * Only support font related properties so far */ export class Style implements IDisposable { /** @hidden */ _host: AdvancedDynamicTexture; /** @hidden */ _fontSize: ValueAndUnit; /** * Observable raised when the style values are changed */ onChangedObservable: Observable