|
@@ -1,4 +1,5 @@
|
|
|
declare module "babylonjs-gui/2D/controls/focusableControl" {
|
|
|
+ import { IKeyboardEvent } from "babylonjs/Events/deviceInputEvents";
|
|
|
import { Nullable } from "babylonjs/types";
|
|
|
import { Control } from "babylonjs-gui/2D/controls/control";
|
|
|
/**
|
|
@@ -17,7 +18,7 @@ declare module "babylonjs-gui/2D/controls/focusableControl" {
|
|
|
* Function called to let the control handle keyboard events
|
|
|
* @param evt defines the current keyboard event
|
|
|
*/
|
|
|
- processKeyboard(evt: KeyboardEvent): void;
|
|
|
+ processKeyboard(evt: IKeyboardEvent): void;
|
|
|
/**
|
|
|
* Function called to get the list of controls that should not steal the focus from this control
|
|
|
* @returns an array of controls
|
|
@@ -2211,6 +2212,7 @@ declare module "babylonjs-gui/2D/controls/inputText" {
|
|
|
import { VirtualKeyboard } from "babylonjs-gui/2D/controls/virtualKeyboard";
|
|
|
import { Measure } from "babylonjs-gui/2D/measure";
|
|
|
import { TextWrapper } from "babylonjs-gui/2D/controls/textWrapper";
|
|
|
+ import { IKeyboardEvent } from 'babylonjs/Events/deviceInputEvents';
|
|
|
/**
|
|
|
* Class used to create input text control
|
|
|
*/
|
|
@@ -2270,7 +2272,7 @@ declare module "babylonjs-gui/2D/controls/inputText" {
|
|
|
/** Observable raised when paste event is triggered */
|
|
|
onTextPasteObservable: Observable<InputText>;
|
|
|
/** Observable raised when a key event was processed */
|
|
|
- onKeyboardEventProcessedObservable: Observable<KeyboardEvent>;
|
|
|
+ onKeyboardEventProcessedObservable: Observable<IKeyboardEvent>;
|
|
|
/** Gets or sets the maximum width allowed by the control */
|
|
|
get maxWidth(): string | number;
|
|
|
/** Gets the maximum width allowed by the control in pixels */
|
|
@@ -2355,7 +2357,7 @@ declare module "babylonjs-gui/2D/controls/inputText" {
|
|
|
*/
|
|
|
keepsFocusWith(): Nullable<Control[]>;
|
|
|
/** @hidden */
|
|
|
- processKey(keyCode: number, key?: string, evt?: KeyboardEvent): void;
|
|
|
+ processKey(keyCode: number, key?: string, evt?: IKeyboardEvent): void;
|
|
|
/** @hidden */
|
|
|
private _updateValueFromCursorIndex;
|
|
|
/** @hidden */
|
|
@@ -2366,7 +2368,7 @@ declare module "babylonjs-gui/2D/controls/inputText" {
|
|
|
* Handles the keyboard event
|
|
|
* @param evt Defines the KeyboardEvent
|
|
|
*/
|
|
|
- processKeyboard(evt: KeyboardEvent): void;
|
|
|
+ processKeyboard(evt: IKeyboardEvent): void;
|
|
|
/** @hidden */
|
|
|
private _onCopyText;
|
|
|
/** @hidden */
|
|
@@ -2627,6 +2629,7 @@ declare module "babylonjs-gui/2D/controls/focusableButton" {
|
|
|
import { PointerInfoBase } from 'babylonjs/Events/pointerEvents';
|
|
|
import { IFocusableControl } from "babylonjs-gui/2D/controls/focusableControl";
|
|
|
import { Observable } from 'babylonjs/Misc/observable';
|
|
|
+ import { IKeyboardEvent } from "babylonjs/Events/deviceInputEvents";
|
|
|
/**
|
|
|
* Class used to create a focusable button that can easily handle keyboard events
|
|
|
*/
|
|
@@ -2641,7 +2644,7 @@ declare module "babylonjs-gui/2D/controls/focusableButton" {
|
|
|
/** Observable raised when the control loses the focus */
|
|
|
onBlurObservable: Observable<Button>;
|
|
|
/** Observable raised when a key event was processed */
|
|
|
- onKeyboardEventProcessedObservable: Observable<KeyboardEvent>;
|
|
|
+ onKeyboardEventProcessedObservable: Observable<IKeyboardEvent>;
|
|
|
constructor(name?: string | undefined);
|
|
|
/** @hidden */
|
|
|
onBlur(): void;
|
|
@@ -2664,7 +2667,7 @@ declare module "babylonjs-gui/2D/controls/focusableButton" {
|
|
|
* Handles the keyboard event
|
|
|
* @param evt Defines the KeyboardEvent
|
|
|
*/
|
|
|
- processKeyboard(evt: KeyboardEvent): void;
|
|
|
+ processKeyboard(evt: IKeyboardEvent): void;
|
|
|
/** @hidden */
|
|
|
_onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean;
|
|
|
/** @hidden */
|
|
@@ -3992,6 +3995,119 @@ declare module "babylonjs-gui/3D/controls/container3D" {
|
|
|
static readonly FACEFORWARDREVERSED_ORIENTATION: number;
|
|
|
}
|
|
|
}
|
|
|
+declare module "babylonjs-gui/3D/controls/button3D" {
|
|
|
+ import { int } from "babylonjs/types";
|
|
|
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
|
|
|
+ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
+ import { Material } from "babylonjs/Materials/material";
|
|
|
+ import { Scene } from "babylonjs/scene";
|
|
|
+ import { AbstractButton3D } from "babylonjs-gui/3D/controls/abstractButton3D";
|
|
|
+ import { AdvancedDynamicTexture } from "babylonjs-gui/2D/advancedDynamicTexture";
|
|
|
+ import { Control } from "babylonjs-gui/2D/controls/control";
|
|
|
+ /**
|
|
|
+ * Class used to create a button in 3D
|
|
|
+ */
|
|
|
+ export class Button3D extends AbstractButton3D {
|
|
|
+ /** @hidden */
|
|
|
+ protected _currentMaterial: Material;
|
|
|
+ private _facadeTexture;
|
|
|
+ private _content;
|
|
|
+ private _contentResolution;
|
|
|
+ private _contentScaleRatio;
|
|
|
+ /**
|
|
|
+ * Gets or sets the texture resolution used to render content (512 by default)
|
|
|
+ */
|
|
|
+ get contentResolution(): int;
|
|
|
+ set contentResolution(value: int);
|
|
|
+ /**
|
|
|
+ * Gets or sets the texture scale ratio used to render content (2 by default)
|
|
|
+ */
|
|
|
+ get contentScaleRatio(): number;
|
|
|
+ set contentScaleRatio(value: number);
|
|
|
+ protected _disposeFacadeTexture(): void;
|
|
|
+ protected _resetContent(): void;
|
|
|
+ /**
|
|
|
+ * Creates a new button
|
|
|
+ * @param name defines the control name
|
|
|
+ */
|
|
|
+ constructor(name?: string);
|
|
|
+ /**
|
|
|
+ * Gets or sets the GUI 2D content used to display the button's facade
|
|
|
+ */
|
|
|
+ get content(): Control;
|
|
|
+ set content(value: Control);
|
|
|
+ /**
|
|
|
+ * Apply the facade texture (created from the content property).
|
|
|
+ * This function can be overloaded by child classes
|
|
|
+ * @param facadeTexture defines the AdvancedDynamicTexture to use
|
|
|
+ */
|
|
|
+ protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
|
|
|
+ protected _getTypeName(): string;
|
|
|
+ protected _createNode(scene: Scene): TransformNode;
|
|
|
+ protected _affectMaterial(mesh: AbstractMesh): void;
|
|
|
+ /**
|
|
|
+ * Releases all associated resources
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs-gui/3D/controls/touchButton3D" {
|
|
|
+ import { Vector3 } from "babylonjs/Maths/math.vector";
|
|
|
+ import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
+ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
|
|
|
+ import { Scene } from "babylonjs/scene";
|
|
|
+ import { Button3D } from "babylonjs-gui/3D/controls/button3D";
|
|
|
+ /**
|
|
|
+ * Class used to create a touchable button in 3D
|
|
|
+ */
|
|
|
+ export class TouchButton3D extends Button3D {
|
|
|
+ private _collisionMesh;
|
|
|
+ private _collidableFrontDirection;
|
|
|
+ private _lastTouchPoint;
|
|
|
+ private _tempButtonForwardRay;
|
|
|
+ private _lastKnownCollidableScale;
|
|
|
+ private _collidableInitialized;
|
|
|
+ private _frontOffset;
|
|
|
+ private _backOffset;
|
|
|
+ private _hoverOffset;
|
|
|
+ private _pushThroughBackOffset;
|
|
|
+ private _activeInteractions;
|
|
|
+ private _previousHeight;
|
|
|
+ /**
|
|
|
+ * Creates a new touchable button
|
|
|
+ * @param name defines the control name
|
|
|
+ * @param collisionMesh mesh to track collisions with
|
|
|
+ */
|
|
|
+ constructor(name?: string, collisionMesh?: Mesh);
|
|
|
+ /**
|
|
|
+ * Sets the front-facing direction of the button
|
|
|
+ * @param frontDir the forward direction of the button
|
|
|
+ */
|
|
|
+ set collidableFrontDirection(frontWorldDir: Vector3);
|
|
|
+ private _getWorldMatrixData;
|
|
|
+ /**
|
|
|
+ * Sets the mesh used for testing input collision
|
|
|
+ * @param collisionMesh the new collision mesh for the button
|
|
|
+ */
|
|
|
+ set collisionMesh(collisionMesh: Mesh);
|
|
|
+ private _getShortestDistancePointToLine;
|
|
|
+ private _isPrimedForInteraction;
|
|
|
+ private _getPointOnButton;
|
|
|
+ private _updateDistanceOffsets;
|
|
|
+ private _getHeightFromButtonCenter;
|
|
|
+ private _getDistanceOffPlane;
|
|
|
+ private _updateButtonState;
|
|
|
+ /** @hidden */
|
|
|
+ _collisionCheckForStateChange(mesh: AbstractMesh): void;
|
|
|
+ protected _getTypeName(): string;
|
|
|
+ protected _createNode(scene: Scene): TransformNode;
|
|
|
+ /**
|
|
|
+ * Releases all associated resources
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
declare module "babylonjs-gui/3D/gui3DManager" {
|
|
|
import { Nullable } from "babylonjs/types";
|
|
|
import { Observable } from "babylonjs/Misc/observable";
|
|
@@ -4012,6 +4128,7 @@ declare module "babylonjs-gui/3D/gui3DManager" {
|
|
|
private _rootContainer;
|
|
|
private _pointerObserver;
|
|
|
private _pointerOutObserver;
|
|
|
+ private _touchableButtons;
|
|
|
/** @hidden */
|
|
|
_lastPickedControl: Control3D;
|
|
|
/** @hidden */
|
|
@@ -4030,6 +4147,10 @@ declare module "babylonjs-gui/3D/gui3DManager" {
|
|
|
_sharedMaterials: {
|
|
|
[key: string]: Material;
|
|
|
};
|
|
|
+ /** @hidden */
|
|
|
+ _touchSharedMaterials: {
|
|
|
+ [key: string]: Material;
|
|
|
+ };
|
|
|
/** Gets the hosting scene */
|
|
|
get scene(): Scene;
|
|
|
/** Gets associated utility layer */
|
|
@@ -4041,6 +4162,7 @@ declare module "babylonjs-gui/3D/gui3DManager" {
|
|
|
constructor(scene?: Scene);
|
|
|
private _handlePointerOut;
|
|
|
private _doPicking;
|
|
|
+ private _processTouchControls;
|
|
|
/**
|
|
|
* Gets the root container
|
|
|
*/
|
|
@@ -4268,62 +4390,6 @@ declare module "babylonjs-gui/3D/controls/abstractButton3D" {
|
|
|
protected _createNode(scene: Scene): TransformNode;
|
|
|
}
|
|
|
}
|
|
|
-declare module "babylonjs-gui/3D/controls/button3D" {
|
|
|
- import { int } from "babylonjs/types";
|
|
|
- import { TransformNode } from "babylonjs/Meshes/transformNode";
|
|
|
- import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
- import { Material } from "babylonjs/Materials/material";
|
|
|
- import { Scene } from "babylonjs/scene";
|
|
|
- import { AbstractButton3D } from "babylonjs-gui/3D/controls/abstractButton3D";
|
|
|
- import { AdvancedDynamicTexture } from "babylonjs-gui/2D/advancedDynamicTexture";
|
|
|
- import { Control } from "babylonjs-gui/2D/controls/control";
|
|
|
- /**
|
|
|
- * Class used to create a button in 3D
|
|
|
- */
|
|
|
- export class Button3D extends AbstractButton3D {
|
|
|
- /** @hidden */
|
|
|
- protected _currentMaterial: Material;
|
|
|
- private _facadeTexture;
|
|
|
- private _content;
|
|
|
- private _contentResolution;
|
|
|
- private _contentScaleRatio;
|
|
|
- /**
|
|
|
- * Gets or sets the texture resolution used to render content (512 by default)
|
|
|
- */
|
|
|
- get contentResolution(): int;
|
|
|
- set contentResolution(value: int);
|
|
|
- /**
|
|
|
- * Gets or sets the texture scale ratio used to render content (2 by default)
|
|
|
- */
|
|
|
- get contentScaleRatio(): number;
|
|
|
- set contentScaleRatio(value: number);
|
|
|
- protected _disposeFacadeTexture(): void;
|
|
|
- protected _resetContent(): void;
|
|
|
- /**
|
|
|
- * Creates a new button
|
|
|
- * @param name defines the control name
|
|
|
- */
|
|
|
- constructor(name?: string);
|
|
|
- /**
|
|
|
- * Gets or sets the GUI 2D content used to display the button's facade
|
|
|
- */
|
|
|
- get content(): Control;
|
|
|
- set content(value: Control);
|
|
|
- /**
|
|
|
- * Apply the facade texture (created from the content property).
|
|
|
- * This function can be overloaded by child classes
|
|
|
- * @param facadeTexture defines the AdvancedDynamicTexture to use
|
|
|
- */
|
|
|
- protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
|
|
|
- protected _getTypeName(): string;
|
|
|
- protected _createNode(scene: Scene): TransformNode;
|
|
|
- protected _affectMaterial(mesh: AbstractMesh): void;
|
|
|
- /**
|
|
|
- * Releases all associated resources
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
declare module "babylonjs-gui/3D/controls/volumeBasedPanel" {
|
|
|
import { Vector3 } from "babylonjs/Maths/math.vector";
|
|
|
import { int } from "babylonjs/types";
|
|
@@ -4685,6 +4751,118 @@ declare module "babylonjs-gui/3D/controls/stackPanel3D" {
|
|
|
protected _arrangeChildren(): void;
|
|
|
}
|
|
|
}
|
|
|
+declare module "babylonjs-gui/3D/controls/touchMeshButton3D" {
|
|
|
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
|
|
|
+ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
+ import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
+ import { Scene } from "babylonjs/scene";
|
|
|
+ import { TouchButton3D } from "babylonjs-gui/3D/controls/touchButton3D";
|
|
|
+ /**
|
|
|
+ * Class used to create an interactable object. It's a touchable 3D button using a mesh coming from the current scene
|
|
|
+ */
|
|
|
+ export class TouchMeshButton3D extends TouchButton3D {
|
|
|
+ /** @hidden */
|
|
|
+ protected _currentMesh: Mesh;
|
|
|
+ /**
|
|
|
+ * Creates a new 3D button based on a mesh
|
|
|
+ * @param mesh mesh to become a 3D button
|
|
|
+ * @param collisionMesh mesh to track collisions with
|
|
|
+ * @param name defines the control name
|
|
|
+ */
|
|
|
+ constructor(mesh: Mesh, options: {
|
|
|
+ collisionMesh: Mesh;
|
|
|
+ useDynamicMesh?: boolean;
|
|
|
+ }, name?: string);
|
|
|
+ protected _getTypeName(): string;
|
|
|
+ protected _createNode(scene: Scene): TransformNode;
|
|
|
+ protected _affectMaterial(mesh: AbstractMesh): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs-gui/3D/controls/touchHolographicButton" {
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
+ import { StandardMaterial } from "babylonjs/Materials/standardMaterial";
|
|
|
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
|
|
|
+ import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
+ import { Scene } from "babylonjs/scene";
|
|
|
+ import { FluentMaterial } from "babylonjs-gui/3D/materials/fluentMaterial";
|
|
|
+ import { AdvancedDynamicTexture } from "babylonjs-gui/2D/advancedDynamicTexture";
|
|
|
+ import { TouchButton3D } from "babylonjs-gui/3D/controls/touchButton3D";
|
|
|
+ /**
|
|
|
+ * Class used to create a holographic button in 3D
|
|
|
+ */
|
|
|
+ export class TouchHolographicButton extends TouchButton3D {
|
|
|
+ private _backPlate;
|
|
|
+ private _textPlate;
|
|
|
+ private _frontPlate;
|
|
|
+ private _text;
|
|
|
+ private _imageUrl;
|
|
|
+ private _shareMaterials;
|
|
|
+ private _frontMaterial;
|
|
|
+ private _backMaterial;
|
|
|
+ private _plateMaterial;
|
|
|
+ private _pickedPointObserver;
|
|
|
+ private _tooltipFade;
|
|
|
+ private _tooltipTextBlock;
|
|
|
+ private _tooltipTexture;
|
|
|
+ private _tooltipMesh;
|
|
|
+ private _tooltipHoverObserver;
|
|
|
+ private _tooltipOutObserver;
|
|
|
+ private _disposeTooltip;
|
|
|
+ /**
|
|
|
+ * Rendering ground id of all the mesh in the button
|
|
|
+ */
|
|
|
+ set renderingGroupId(id: number);
|
|
|
+ get renderingGroupId(): number;
|
|
|
+ /**
|
|
|
+ * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)
|
|
|
+ */
|
|
|
+ set tooltipText(text: Nullable<string>);
|
|
|
+ get tooltipText(): Nullable<string>;
|
|
|
+ /**
|
|
|
+ * Gets or sets text for the button
|
|
|
+ */
|
|
|
+ get text(): string;
|
|
|
+ set text(value: string);
|
|
|
+ /**
|
|
|
+ * Gets or sets the image url for the button
|
|
|
+ */
|
|
|
+ get imageUrl(): string;
|
|
|
+ set imageUrl(value: string);
|
|
|
+ /**
|
|
|
+ * Gets the back material used by this button
|
|
|
+ */
|
|
|
+ get backMaterial(): FluentMaterial;
|
|
|
+ /**
|
|
|
+ * Gets the front material used by this button
|
|
|
+ */
|
|
|
+ get frontMaterial(): FluentMaterial;
|
|
|
+ /**
|
|
|
+ * Gets the plate material used by this button
|
|
|
+ */
|
|
|
+ get plateMaterial(): StandardMaterial;
|
|
|
+ /**
|
|
|
+ * Gets a boolean indicating if this button shares its material with other HolographicButtons
|
|
|
+ */
|
|
|
+ get shareMaterials(): boolean;
|
|
|
+ /**
|
|
|
+ * Creates a new button
|
|
|
+ * @param name defines the control name
|
|
|
+ */
|
|
|
+ constructor(name?: string, shareMaterials?: boolean);
|
|
|
+ protected _getTypeName(): string;
|
|
|
+ private _rebuildContent;
|
|
|
+ protected _createNode(scene: Scene): TransformNode;
|
|
|
+ protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
|
|
|
+ private _createBackMaterial;
|
|
|
+ private _createFrontMaterial;
|
|
|
+ private _createPlateMaterial;
|
|
|
+ protected _affectMaterial(mesh: Mesh): void;
|
|
|
+ /**
|
|
|
+ * Releases all associated resources
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
declare module "babylonjs-gui/3D/controls/index" {
|
|
|
export * from "babylonjs-gui/3D/controls/abstractButton3D";
|
|
|
export * from "babylonjs-gui/3D/controls/button3D";
|
|
@@ -4697,6 +4875,9 @@ declare module "babylonjs-gui/3D/controls/index" {
|
|
|
export * from "babylonjs-gui/3D/controls/scatterPanel";
|
|
|
export * from "babylonjs-gui/3D/controls/spherePanel";
|
|
|
export * from "babylonjs-gui/3D/controls/stackPanel3D";
|
|
|
+ export * from "babylonjs-gui/3D/controls/touchButton3D";
|
|
|
+ export * from "babylonjs-gui/3D/controls/touchMeshButton3D";
|
|
|
+ export * from "babylonjs-gui/3D/controls/touchHolographicButton";
|
|
|
export * from "babylonjs-gui/3D/controls/volumeBasedPanel";
|
|
|
}
|
|
|
declare module "babylonjs-gui/3D/materials/index" {
|
|
@@ -4735,7 +4916,7 @@ declare module BABYLON.GUI {
|
|
|
* Function called to let the control handle keyboard events
|
|
|
* @param evt defines the current keyboard event
|
|
|
*/
|
|
|
- processKeyboard(evt: KeyboardEvent): void;
|
|
|
+ processKeyboard(evt: BABYLON.IKeyboardEvent): void;
|
|
|
/**
|
|
|
* Function called to get the list of controls that should not steal the focus from this control
|
|
|
* @returns an array of controls
|
|
@@ -6910,7 +7091,7 @@ declare module BABYLON.GUI {
|
|
|
/** BABYLON.Observable raised when paste event is triggered */
|
|
|
onTextPasteObservable: BABYLON.Observable<InputText>;
|
|
|
/** BABYLON.Observable raised when a key event was processed */
|
|
|
- onKeyboardEventProcessedObservable: BABYLON.Observable<KeyboardEvent>;
|
|
|
+ onKeyboardEventProcessedObservable: BABYLON.Observable<BABYLON.IKeyboardEvent>;
|
|
|
/** Gets or sets the maximum width allowed by the control */
|
|
|
get maxWidth(): string | number;
|
|
|
/** Gets the maximum width allowed by the control in pixels */
|
|
@@ -6995,7 +7176,7 @@ declare module BABYLON.GUI {
|
|
|
*/
|
|
|
keepsFocusWith(): BABYLON.Nullable<Control[]>;
|
|
|
/** @hidden */
|
|
|
- processKey(keyCode: number, key?: string, evt?: KeyboardEvent): void;
|
|
|
+ processKey(keyCode: number, key?: string, evt?: BABYLON.IKeyboardEvent): void;
|
|
|
/** @hidden */
|
|
|
private _updateValueFromCursorIndex;
|
|
|
/** @hidden */
|
|
@@ -7006,7 +7187,7 @@ declare module BABYLON.GUI {
|
|
|
* Handles the keyboard event
|
|
|
* @param evt Defines the KeyboardEvent
|
|
|
*/
|
|
|
- processKeyboard(evt: KeyboardEvent): void;
|
|
|
+ processKeyboard(evt: BABYLON.IKeyboardEvent): void;
|
|
|
/** @hidden */
|
|
|
private _onCopyText;
|
|
|
/** @hidden */
|
|
@@ -7260,7 +7441,7 @@ declare module BABYLON.GUI {
|
|
|
/** BABYLON.Observable raised when the control loses the focus */
|
|
|
onBlurObservable: BABYLON.Observable<Button>;
|
|
|
/** BABYLON.Observable raised when a key event was processed */
|
|
|
- onKeyboardEventProcessedObservable: BABYLON.Observable<KeyboardEvent>;
|
|
|
+ onKeyboardEventProcessedObservable: BABYLON.Observable<BABYLON.IKeyboardEvent>;
|
|
|
constructor(name?: string | undefined);
|
|
|
/** @hidden */
|
|
|
onBlur(): void;
|
|
@@ -7283,7 +7464,7 @@ declare module BABYLON.GUI {
|
|
|
* Handles the keyboard event
|
|
|
* @param evt Defines the KeyboardEvent
|
|
|
*/
|
|
|
- processKeyboard(evt: KeyboardEvent): void;
|
|
|
+ processKeyboard(evt: BABYLON.IKeyboardEvent): void;
|
|
|
/** @hidden */
|
|
|
_onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, pi: BABYLON.PointerInfoBase): boolean;
|
|
|
/** @hidden */
|
|
@@ -8497,6 +8678,105 @@ declare module BABYLON.GUI {
|
|
|
}
|
|
|
declare module BABYLON.GUI {
|
|
|
/**
|
|
|
+ * Class used to create a button in 3D
|
|
|
+ */
|
|
|
+ export class Button3D extends AbstractButton3D {
|
|
|
+ /** @hidden */
|
|
|
+ protected _currentMaterial: BABYLON.Material;
|
|
|
+ private _facadeTexture;
|
|
|
+ private _content;
|
|
|
+ private _contentResolution;
|
|
|
+ private _contentScaleRatio;
|
|
|
+ /**
|
|
|
+ * Gets or sets the texture resolution used to render content (512 by default)
|
|
|
+ */
|
|
|
+ get contentResolution(): BABYLON.int;
|
|
|
+ set contentResolution(value: BABYLON.int);
|
|
|
+ /**
|
|
|
+ * Gets or sets the texture scale ratio used to render content (2 by default)
|
|
|
+ */
|
|
|
+ get contentScaleRatio(): number;
|
|
|
+ set contentScaleRatio(value: number);
|
|
|
+ protected _disposeFacadeTexture(): void;
|
|
|
+ protected _resetContent(): void;
|
|
|
+ /**
|
|
|
+ * Creates a new button
|
|
|
+ * @param name defines the control name
|
|
|
+ */
|
|
|
+ constructor(name?: string);
|
|
|
+ /**
|
|
|
+ * Gets or sets the GUI 2D content used to display the button's facade
|
|
|
+ */
|
|
|
+ get content(): Control;
|
|
|
+ set content(value: Control);
|
|
|
+ /**
|
|
|
+ * Apply the facade texture (created from the content property).
|
|
|
+ * This function can be overloaded by child classes
|
|
|
+ * @param facadeTexture defines the AdvancedDynamicTexture to use
|
|
|
+ */
|
|
|
+ protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
|
|
|
+ protected _getTypeName(): string;
|
|
|
+ protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
|
|
|
+ protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
|
|
|
+ /**
|
|
|
+ * Releases all associated resources
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON.GUI {
|
|
|
+ /**
|
|
|
+ * Class used to create a touchable button in 3D
|
|
|
+ */
|
|
|
+ export class TouchButton3D extends Button3D {
|
|
|
+ private _collisionMesh;
|
|
|
+ private _collidableFrontDirection;
|
|
|
+ private _lastTouchPoint;
|
|
|
+ private _tempButtonForwardRay;
|
|
|
+ private _lastKnownCollidableScale;
|
|
|
+ private _collidableInitialized;
|
|
|
+ private _frontOffset;
|
|
|
+ private _backOffset;
|
|
|
+ private _hoverOffset;
|
|
|
+ private _pushThroughBackOffset;
|
|
|
+ private _activeInteractions;
|
|
|
+ private _previousHeight;
|
|
|
+ /**
|
|
|
+ * Creates a new touchable button
|
|
|
+ * @param name defines the control name
|
|
|
+ * @param collisionMesh mesh to track collisions with
|
|
|
+ */
|
|
|
+ constructor(name?: string, collisionMesh?: BABYLON.Mesh);
|
|
|
+ /**
|
|
|
+ * Sets the front-facing direction of the button
|
|
|
+ * @param frontDir the forward direction of the button
|
|
|
+ */
|
|
|
+ set collidableFrontDirection(frontWorldDir: BABYLON.Vector3);
|
|
|
+ private _getWorldMatrixData;
|
|
|
+ /**
|
|
|
+ * Sets the mesh used for testing input collision
|
|
|
+ * @param collisionMesh the new collision mesh for the button
|
|
|
+ */
|
|
|
+ set collisionMesh(collisionMesh: BABYLON.Mesh);
|
|
|
+ private _getShortestDistancePointToLine;
|
|
|
+ private _isPrimedForInteraction;
|
|
|
+ private _getPointOnButton;
|
|
|
+ private _updateDistanceOffsets;
|
|
|
+ private _getHeightFromButtonCenter;
|
|
|
+ private _getDistanceOffPlane;
|
|
|
+ private _updateButtonState;
|
|
|
+ /** @hidden */
|
|
|
+ _collisionCheckForStateChange(mesh: BABYLON.AbstractMesh): void;
|
|
|
+ protected _getTypeName(): string;
|
|
|
+ protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
|
|
|
+ /**
|
|
|
+ * Releases all associated resources
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON.GUI {
|
|
|
+ /**
|
|
|
* Class used to manage 3D user interface
|
|
|
* @see https://doc.babylonjs.com/how_to/gui3d
|
|
|
*/
|
|
@@ -8507,6 +8787,7 @@ declare module BABYLON.GUI {
|
|
|
private _rootContainer;
|
|
|
private _pointerObserver;
|
|
|
private _pointerOutObserver;
|
|
|
+ private _touchableButtons;
|
|
|
/** @hidden */
|
|
|
_lastPickedControl: Control3D;
|
|
|
/** @hidden */
|
|
@@ -8525,6 +8806,10 @@ declare module BABYLON.GUI {
|
|
|
_sharedMaterials: {
|
|
|
[key: string]: BABYLON.Material;
|
|
|
};
|
|
|
+ /** @hidden */
|
|
|
+ _touchSharedMaterials: {
|
|
|
+ [key: string]: BABYLON.Material;
|
|
|
+ };
|
|
|
/** Gets the hosting scene */
|
|
|
get scene(): BABYLON.Scene;
|
|
|
/** Gets associated utility layer */
|
|
@@ -8536,6 +8821,7 @@ declare module BABYLON.GUI {
|
|
|
constructor(scene?: BABYLON.Scene);
|
|
|
private _handlePointerOut;
|
|
|
private _doPicking;
|
|
|
+ private _processTouchControls;
|
|
|
/**
|
|
|
* Gets the root container
|
|
|
*/
|
|
@@ -8751,54 +9037,6 @@ declare module BABYLON.GUI {
|
|
|
}
|
|
|
declare module BABYLON.GUI {
|
|
|
/**
|
|
|
- * Class used to create a button in 3D
|
|
|
- */
|
|
|
- export class Button3D extends AbstractButton3D {
|
|
|
- /** @hidden */
|
|
|
- protected _currentMaterial: BABYLON.Material;
|
|
|
- private _facadeTexture;
|
|
|
- private _content;
|
|
|
- private _contentResolution;
|
|
|
- private _contentScaleRatio;
|
|
|
- /**
|
|
|
- * Gets or sets the texture resolution used to render content (512 by default)
|
|
|
- */
|
|
|
- get contentResolution(): BABYLON.int;
|
|
|
- set contentResolution(value: BABYLON.int);
|
|
|
- /**
|
|
|
- * Gets or sets the texture scale ratio used to render content (2 by default)
|
|
|
- */
|
|
|
- get contentScaleRatio(): number;
|
|
|
- set contentScaleRatio(value: number);
|
|
|
- protected _disposeFacadeTexture(): void;
|
|
|
- protected _resetContent(): void;
|
|
|
- /**
|
|
|
- * Creates a new button
|
|
|
- * @param name defines the control name
|
|
|
- */
|
|
|
- constructor(name?: string);
|
|
|
- /**
|
|
|
- * Gets or sets the GUI 2D content used to display the button's facade
|
|
|
- */
|
|
|
- get content(): Control;
|
|
|
- set content(value: Control);
|
|
|
- /**
|
|
|
- * Apply the facade texture (created from the content property).
|
|
|
- * This function can be overloaded by child classes
|
|
|
- * @param facadeTexture defines the AdvancedDynamicTexture to use
|
|
|
- */
|
|
|
- protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
|
|
|
- protected _getTypeName(): string;
|
|
|
- protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
|
|
|
- protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
|
|
|
- /**
|
|
|
- * Releases all associated resources
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module BABYLON.GUI {
|
|
|
- /**
|
|
|
* Abstract class used to create a container panel deployed on the surface of a volume
|
|
|
*/
|
|
|
export abstract class VolumeBasedPanel extends Container3D {
|
|
@@ -9112,4 +9350,103 @@ declare module BABYLON.GUI {
|
|
|
constructor(isVertical?: boolean);
|
|
|
protected _arrangeChildren(): void;
|
|
|
}
|
|
|
+}
|
|
|
+declare module BABYLON.GUI {
|
|
|
+ /**
|
|
|
+ * Class used to create an interactable object. It's a touchable 3D button using a mesh coming from the current scene
|
|
|
+ */
|
|
|
+ export class TouchMeshButton3D extends TouchButton3D {
|
|
|
+ /** @hidden */
|
|
|
+ protected _currentMesh: BABYLON.Mesh;
|
|
|
+ /**
|
|
|
+ * Creates a new 3D button based on a mesh
|
|
|
+ * @param mesh mesh to become a 3D button
|
|
|
+ * @param collisionMesh mesh to track collisions with
|
|
|
+ * @param name defines the control name
|
|
|
+ */
|
|
|
+ constructor(mesh: BABYLON.Mesh, options: {
|
|
|
+ collisionMesh: BABYLON.Mesh;
|
|
|
+ useDynamicMesh?: boolean;
|
|
|
+ }, name?: string);
|
|
|
+ protected _getTypeName(): string;
|
|
|
+ protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
|
|
|
+ protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON.GUI {
|
|
|
+ /**
|
|
|
+ * Class used to create a holographic button in 3D
|
|
|
+ */
|
|
|
+ export class TouchHolographicButton extends TouchButton3D {
|
|
|
+ private _backPlate;
|
|
|
+ private _textPlate;
|
|
|
+ private _frontPlate;
|
|
|
+ private _text;
|
|
|
+ private _imageUrl;
|
|
|
+ private _shareMaterials;
|
|
|
+ private _frontMaterial;
|
|
|
+ private _backMaterial;
|
|
|
+ private _plateMaterial;
|
|
|
+ private _pickedPointObserver;
|
|
|
+ private _tooltipFade;
|
|
|
+ private _tooltipTextBlock;
|
|
|
+ private _tooltipTexture;
|
|
|
+ private _tooltipMesh;
|
|
|
+ private _tooltipHoverObserver;
|
|
|
+ private _tooltipOutObserver;
|
|
|
+ private _disposeTooltip;
|
|
|
+ /**
|
|
|
+ * Rendering ground id of all the mesh in the button
|
|
|
+ */
|
|
|
+ set renderingGroupId(id: number);
|
|
|
+ get renderingGroupId(): number;
|
|
|
+ /**
|
|
|
+ * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)
|
|
|
+ */
|
|
|
+ set tooltipText(text: BABYLON.Nullable<string>);
|
|
|
+ get tooltipText(): BABYLON.Nullable<string>;
|
|
|
+ /**
|
|
|
+ * Gets or sets text for the button
|
|
|
+ */
|
|
|
+ get text(): string;
|
|
|
+ set text(value: string);
|
|
|
+ /**
|
|
|
+ * Gets or sets the image url for the button
|
|
|
+ */
|
|
|
+ get imageUrl(): string;
|
|
|
+ set imageUrl(value: string);
|
|
|
+ /**
|
|
|
+ * Gets the back material used by this button
|
|
|
+ */
|
|
|
+ get backMaterial(): FluentMaterial;
|
|
|
+ /**
|
|
|
+ * Gets the front material used by this button
|
|
|
+ */
|
|
|
+ get frontMaterial(): FluentMaterial;
|
|
|
+ /**
|
|
|
+ * Gets the plate material used by this button
|
|
|
+ */
|
|
|
+ get plateMaterial(): BABYLON.StandardMaterial;
|
|
|
+ /**
|
|
|
+ * Gets a boolean indicating if this button shares its material with other HolographicButtons
|
|
|
+ */
|
|
|
+ get shareMaterials(): boolean;
|
|
|
+ /**
|
|
|
+ * Creates a new button
|
|
|
+ * @param name defines the control name
|
|
|
+ */
|
|
|
+ constructor(name?: string, shareMaterials?: boolean);
|
|
|
+ protected _getTypeName(): string;
|
|
|
+ private _rebuildContent;
|
|
|
+ protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
|
|
|
+ protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
|
|
|
+ private _createBackMaterial;
|
|
|
+ private _createFrontMaterial;
|
|
|
+ private _createPlateMaterial;
|
|
|
+ protected _affectMaterial(mesh: BABYLON.Mesh): void;
|
|
|
+ /**
|
|
|
+ * Releases all associated resources
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
}
|