@babylonjs/gui 5.0.0-rc.7 → 5.0.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2D/adtInstrumentation.d.ts +52 -52
- package/2D/adtInstrumentation.js +126 -126
- package/2D/advancedDynamicTexture.d.ts +448 -448
- package/2D/advancedDynamicTexture.js +1318 -1318
- package/2D/controls/button.d.ts +135 -135
- package/2D/controls/button.js +276 -276
- package/2D/controls/checkbox.d.ts +59 -59
- package/2D/controls/checkbox.js +188 -188
- package/2D/controls/colorpicker.d.ts +103 -103
- package/2D/controls/colorpicker.js +1417 -1417
- package/2D/controls/container.d.ts +175 -175
- package/2D/controls/container.js +570 -570
- package/2D/controls/control.d.ts +866 -866
- package/2D/controls/control.js +2433 -2433
- package/2D/controls/displayGrid.d.ts +53 -53
- package/2D/controls/displayGrid.js +245 -245
- package/2D/controls/ellipse.d.ts +21 -21
- package/2D/controls/ellipse.js +85 -85
- package/2D/controls/focusableButton.d.ts +59 -59
- package/2D/controls/focusableButton.js +99 -99
- package/2D/controls/focusableControl.d.ts +34 -34
- package/2D/controls/focusableControl.js +1 -1
- package/2D/controls/grid.d.ts +139 -139
- package/2D/controls/grid.js +529 -529
- package/2D/controls/image.d.ts +204 -204
- package/2D/controls/image.js +887 -887
- package/2D/controls/index.d.ts +29 -29
- package/2D/controls/index.js +29 -29
- package/2D/controls/inputPassword.d.ts +8 -8
- package/2D/controls/inputPassword.js +25 -25
- package/2D/controls/inputText.d.ts +201 -201
- package/2D/controls/inputText.js +1119 -1119
- package/2D/controls/line.d.ts +66 -66
- package/2D/controls/line.js +271 -271
- package/2D/controls/multiLine.d.ts +75 -75
- package/2D/controls/multiLine.js +262 -262
- package/2D/controls/radioButton.d.ts +49 -49
- package/2D/controls/radioButton.js +205 -205
- package/2D/controls/rectangle.d.ts +29 -29
- package/2D/controls/rectangle.js +150 -150
- package/2D/controls/scrollViewers/scrollViewer.d.ts +182 -182
- package/2D/controls/scrollViewers/scrollViewer.js +677 -677
- package/2D/controls/scrollViewers/scrollViewerWindow.d.ts +57 -57
- package/2D/controls/scrollViewers/scrollViewerWindow.js +278 -278
- package/2D/controls/selector.d.ts +263 -263
- package/2D/controls/selector.js +692 -692
- package/2D/controls/sliders/baseSlider.d.ts +82 -82
- package/2D/controls/sliders/baseSlider.js +347 -347
- package/2D/controls/sliders/imageBasedSlider.d.ts +49 -49
- package/2D/controls/sliders/imageBasedSlider.js +192 -192
- package/2D/controls/sliders/imageScrollBar.d.ts +65 -65
- package/2D/controls/sliders/imageScrollBar.js +263 -263
- package/2D/controls/sliders/scrollBar.d.ts +38 -38
- package/2D/controls/sliders/scrollBar.js +143 -143
- package/2D/controls/sliders/slider.d.ts +35 -35
- package/2D/controls/sliders/slider.js +271 -271
- package/2D/controls/stackPanel.d.ts +64 -64
- package/2D/controls/stackPanel.js +246 -246
- package/2D/controls/statics.d.ts +6 -6
- package/2D/controls/statics.js +49 -49
- package/2D/controls/textBlock.d.ts +175 -175
- package/2D/controls/textBlock.js +603 -603
- package/2D/controls/textWrapper.d.ts +13 -13
- package/2D/controls/textWrapper.js +101 -101
- package/2D/controls/toggleButton.d.ts +117 -117
- package/2D/controls/toggleButton.js +268 -268
- package/2D/controls/virtualKeyboard.d.ts +96 -96
- package/2D/controls/virtualKeyboard.js +256 -256
- package/2D/index.d.ts +9 -9
- package/2D/index.js +9 -9
- package/2D/math2D.d.ts +117 -117
- package/2D/math2D.js +221 -221
- package/2D/measure.d.ts +77 -77
- package/2D/measure.js +139 -139
- package/2D/multiLinePoint.d.ts +47 -47
- package/2D/multiLinePoint.js +127 -127
- package/2D/style.d.ts +46 -46
- package/2D/style.js +97 -97
- package/2D/valueAndUnit.d.ts +89 -89
- package/2D/valueAndUnit.js +226 -226
- package/2D/xmlLoader.d.ts +60 -60
- package/2D/xmlLoader.js +348 -348
- package/3D/behaviors/defaultBehavior.d.ts +73 -73
- package/3D/behaviors/defaultBehavior.js +121 -121
- package/3D/controls/abstractButton3D.d.ts +15 -15
- package/3D/controls/abstractButton3D.js +25 -25
- package/3D/controls/button3D.d.ts +30 -30
- package/3D/controls/button3D.js +93 -93
- package/3D/controls/container3D.d.ts +72 -72
- package/3D/controls/container3D.js +139 -139
- package/3D/controls/contentDisplay3D.d.ts +30 -30
- package/3D/controls/contentDisplay3D.js +79 -79
- package/3D/controls/control3D.d.ts +201 -201
- package/3D/controls/control3D.js +445 -445
- package/3D/controls/cylinderPanel.d.ts +17 -17
- package/3D/controls/cylinderPanel.js +66 -66
- package/3D/controls/handMenu.d.ts +28 -28
- package/3D/controls/handMenu.js +47 -47
- package/3D/controls/holographicBackplate.d.ts +49 -49
- package/3D/controls/holographicBackplate.js +120 -120
- package/3D/controls/holographicButton.d.ts +84 -84
- package/3D/controls/holographicButton.js +339 -339
- package/3D/controls/holographicSlate.d.ts +131 -131
- package/3D/controls/holographicSlate.js +431 -431
- package/3D/controls/index.d.ts +21 -21
- package/3D/controls/index.js +21 -21
- package/3D/controls/meshButton3D.d.ts +21 -21
- package/3D/controls/meshButton3D.js +62 -62
- package/3D/controls/nearMenu.d.ts +44 -44
- package/3D/controls/nearMenu.js +114 -114
- package/3D/controls/planePanel.d.ts +9 -9
- package/3D/controls/planePanel.js +36 -36
- package/3D/controls/scatterPanel.d.ts +18 -18
- package/3D/controls/scatterPanel.js +108 -108
- package/3D/controls/slider3D.d.ts +81 -81
- package/3D/controls/slider3D.js +268 -268
- package/3D/controls/spherePanel.d.ts +17 -17
- package/3D/controls/spherePanel.js +67 -67
- package/3D/controls/stackPanel3D.d.ts +22 -22
- package/3D/controls/stackPanel3D.js +107 -107
- package/3D/controls/touchButton3D.d.ts +80 -80
- package/3D/controls/touchButton3D.js +233 -233
- package/3D/controls/touchHolographicButton.d.ts +110 -110
- package/3D/controls/touchHolographicButton.js +445 -445
- package/3D/controls/touchHolographicMenu.d.ts +61 -61
- package/3D/controls/touchHolographicMenu.js +149 -149
- package/3D/controls/touchMeshButton3D.d.ts +21 -21
- package/3D/controls/touchMeshButton3D.js +62 -62
- package/3D/controls/volumeBasedPanel.d.ts +53 -53
- package/3D/controls/volumeBasedPanel.js +174 -174
- package/3D/gizmos/gizmoHandle.d.ts +108 -108
- package/3D/gizmos/gizmoHandle.js +209 -209
- package/3D/gizmos/index.d.ts +2 -2
- package/3D/gizmos/index.js +2 -2
- package/3D/gizmos/slateGizmo.d.ts +57 -57
- package/3D/gizmos/slateGizmo.js +369 -369
- package/3D/gui3DManager.d.ts +94 -94
- package/3D/gui3DManager.js +257 -257
- package/3D/index.d.ts +5 -5
- package/3D/index.js +5 -5
- package/3D/materials/fluent/fluentMaterial.d.ts +90 -90
- package/3D/materials/fluent/fluentMaterial.js +292 -292
- package/3D/materials/fluent/index.d.ts +1 -1
- package/3D/materials/fluent/index.js +1 -1
- package/3D/materials/fluent/shaders/fluent.fragment.d.ts +5 -5
- package/3D/materials/fluent/shaders/fluent.fragment.js +8 -8
- package/3D/materials/fluent/shaders/fluent.vertex.d.ts +5 -5
- package/3D/materials/fluent/shaders/fluent.vertex.js +8 -8
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.d.ts +154 -154
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +469 -469
- package/3D/materials/fluentBackplate/index.d.ts +1 -1
- package/3D/materials/fluentBackplate/index.js +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.d.ts +5 -5
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +8 -8
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.d.ts +5 -5
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +8 -8
- package/3D/materials/fluentButton/fluentButtonMaterial.d.ts +189 -189
- package/3D/materials/fluentButton/fluentButtonMaterial.js +539 -539
- package/3D/materials/fluentButton/index.d.ts +1 -1
- package/3D/materials/fluentButton/index.js +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.d.ts +5 -5
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +8 -8
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.d.ts +5 -5
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +8 -8
- package/3D/materials/fluentMaterial.d.ts +4 -4
- package/3D/materials/fluentMaterial.js +4 -4
- package/3D/materials/handle/handleMaterial.d.ts +68 -68
- package/3D/materials/handle/handleMaterial.js +126 -126
- package/3D/materials/handle/index.d.ts +1 -1
- package/3D/materials/handle/index.js +1 -1
- package/3D/materials/handle/shaders/handle.fragment.d.ts +5 -5
- package/3D/materials/handle/shaders/handle.fragment.js +8 -8
- package/3D/materials/handle/shaders/handle.vertex.d.ts +5 -5
- package/3D/materials/handle/shaders/handle.vertex.js +8 -8
- package/3D/materials/index.d.ts +5 -5
- package/3D/materials/index.js +5 -5
- package/3D/materials/mrdl/index.d.ts +3 -3
- package/3D/materials/mrdl/index.js +3 -3
- package/3D/materials/mrdl/mrdlBackplateMaterial.d.ts +147 -147
- package/3D/materials/mrdl/mrdlBackplateMaterial.js +436 -436
- package/3D/materials/mrdl/mrdlSliderBarMaterial.d.ts +333 -333
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js +851 -851
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.d.ts +333 -333
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +851 -851
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +8 -8
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +8 -8
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +8 -8
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +8 -8
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +8 -8
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +8 -8
- package/3D/vector3WithInfo.d.ts +16 -16
- package/3D/vector3WithInfo.js +23 -23
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/legacy/legacy.d.ts +1 -1
- package/legacy/legacy.js +13 -13
- package/package.json +2 -2
|
@@ -1,448 +1,448 @@
|
|
|
1
|
-
import { Nullable } from "@babylonjs/core/types.js";
|
|
2
|
-
import { Observable } from "@babylonjs/core/Misc/observable.js";
|
|
3
|
-
import { Vector2, Vector3, Matrix } from "@babylonjs/core/Maths/math.vector.js";
|
|
4
|
-
import { ClipboardInfo } from "@babylonjs/core/Events/clipboardEvents.js";
|
|
5
|
-
import { DynamicTexture } from "@babylonjs/core/Materials/Textures/dynamicTexture.js";
|
|
6
|
-
import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
|
|
7
|
-
import { Layer } from "@babylonjs/core/Layers/layer.js";
|
|
8
|
-
import { Scene } from "@babylonjs/core/scene.js";
|
|
9
|
-
import { Container } from "./controls/container";
|
|
10
|
-
import { Control } from "./controls/control";
|
|
11
|
-
import { IFocusableControl } from "./controls/focusableControl";
|
|
12
|
-
import { Style } from "./style";
|
|
13
|
-
import { Viewport } from "@babylonjs/core/Maths/math.viewport.js";
|
|
14
|
-
/**
|
|
15
|
-
* Class used to create texture to support 2D GUI elements
|
|
16
|
-
* @see https://doc.babylonjs.com/how_to/gui
|
|
17
|
-
*/
|
|
18
|
-
export declare class AdvancedDynamicTexture extends DynamicTexture {
|
|
19
|
-
/** Define the Uurl to load snippets */
|
|
20
|
-
static SnippetUrl: string;
|
|
21
|
-
/** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */
|
|
22
|
-
static AllowGPUOptimizations: boolean;
|
|
23
|
-
/** Snippet ID if the content was created from the snippet server */
|
|
24
|
-
snippetId: string;
|
|
25
|
-
private _isDirty;
|
|
26
|
-
private _renderObserver;
|
|
27
|
-
private _resizeObserver;
|
|
28
|
-
private _preKeyboardObserver;
|
|
29
|
-
private _pointerMoveObserver;
|
|
30
|
-
private _sceneRenderObserver;
|
|
31
|
-
private _pointerObserver;
|
|
32
|
-
private _canvasPointerOutObserver;
|
|
33
|
-
private _canvasBlurObserver;
|
|
34
|
-
private _background;
|
|
35
|
-
/** @hidden */
|
|
36
|
-
_rootContainer: Container;
|
|
37
|
-
/** @hidden */
|
|
38
|
-
_lastPickedControl: Control;
|
|
39
|
-
/** @hidden */
|
|
40
|
-
_lastControlOver: {
|
|
41
|
-
[pointerId: number]: Control;
|
|
42
|
-
};
|
|
43
|
-
/** @hidden */
|
|
44
|
-
_lastControlDown: {
|
|
45
|
-
[pointerId: number]: Control;
|
|
46
|
-
};
|
|
47
|
-
/** @hidden */
|
|
48
|
-
_capturingControl: {
|
|
49
|
-
[pointerId: number]: Control;
|
|
50
|
-
};
|
|
51
|
-
/** @hidden */
|
|
52
|
-
_shouldBlockPointer: boolean;
|
|
53
|
-
/** @hidden */
|
|
54
|
-
_layerToDispose: Nullable<Layer>;
|
|
55
|
-
/** @hidden */
|
|
56
|
-
_linkedControls: Control[];
|
|
57
|
-
private _isFullscreen;
|
|
58
|
-
private _fullscreenViewport;
|
|
59
|
-
private _idealWidth;
|
|
60
|
-
private _idealHeight;
|
|
61
|
-
private _useSmallestIdeal;
|
|
62
|
-
private _renderAtIdealSize;
|
|
63
|
-
private _focusedControl;
|
|
64
|
-
private _blockNextFocusCheck;
|
|
65
|
-
private _renderScale;
|
|
66
|
-
private _rootElement;
|
|
67
|
-
private _cursorChanged;
|
|
68
|
-
private _defaultMousePointerId;
|
|
69
|
-
/** @hidden */
|
|
70
|
-
_numLayoutCalls: number;
|
|
71
|
-
/** Gets the number of layout calls made the last time the ADT has been rendered */
|
|
72
|
-
get numLayoutCalls(): number;
|
|
73
|
-
/** @hidden */
|
|
74
|
-
_numRenderCalls: number;
|
|
75
|
-
/** Gets the number of render calls made the last time the ADT has been rendered */
|
|
76
|
-
get numRenderCalls(): number;
|
|
77
|
-
/**
|
|
78
|
-
* Define type to string to ensure compatibility across browsers
|
|
79
|
-
* Safari doesn't support DataTransfer constructor
|
|
80
|
-
*/
|
|
81
|
-
private _clipboardData;
|
|
82
|
-
/**
|
|
83
|
-
* Observable event triggered each time an clipboard event is received from the rendering canvas
|
|
84
|
-
*/
|
|
85
|
-
onClipboardObservable: Observable<ClipboardInfo>;
|
|
86
|
-
/**
|
|
87
|
-
* Observable event triggered each time a pointer down is intercepted by a control
|
|
88
|
-
*/
|
|
89
|
-
onControlPickedObservable: Observable<Control>;
|
|
90
|
-
/**
|
|
91
|
-
* Observable event triggered before layout is evaluated
|
|
92
|
-
*/
|
|
93
|
-
onBeginLayoutObservable: Observable<AdvancedDynamicTexture>;
|
|
94
|
-
/**
|
|
95
|
-
* Observable event triggered after the layout was evaluated
|
|
96
|
-
*/
|
|
97
|
-
onEndLayoutObservable: Observable<AdvancedDynamicTexture>;
|
|
98
|
-
/**
|
|
99
|
-
* Observable event triggered before the texture is rendered
|
|
100
|
-
*/
|
|
101
|
-
onBeginRenderObservable: Observable<AdvancedDynamicTexture>;
|
|
102
|
-
/**
|
|
103
|
-
* Observable event triggered after the texture was rendered
|
|
104
|
-
*/
|
|
105
|
-
onEndRenderObservable: Observable<AdvancedDynamicTexture>;
|
|
106
|
-
/**
|
|
107
|
-
* Gets or sets a boolean defining if alpha is stored as premultiplied
|
|
108
|
-
*/
|
|
109
|
-
premulAlpha: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture
|
|
112
|
-
*/
|
|
113
|
-
applyYInversionOnUpdate: boolean;
|
|
114
|
-
/**
|
|
115
|
-
* Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
|
|
116
|
-
* Useful when you want more antialiasing
|
|
117
|
-
*/
|
|
118
|
-
get renderScale(): number;
|
|
119
|
-
set renderScale(value: number);
|
|
120
|
-
/** Gets or sets the background color */
|
|
121
|
-
get background(): string;
|
|
122
|
-
set background(value: string);
|
|
123
|
-
/**
|
|
124
|
-
* Gets or sets the ideal width used to design controls.
|
|
125
|
-
* The GUI will then rescale everything accordingly
|
|
126
|
-
* @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
|
|
127
|
-
*/
|
|
128
|
-
get idealWidth(): number;
|
|
129
|
-
set idealWidth(value: number);
|
|
130
|
-
/**
|
|
131
|
-
* Gets or sets the ideal height used to design controls.
|
|
132
|
-
* The GUI will then rescale everything accordingly
|
|
133
|
-
* @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
|
|
134
|
-
*/
|
|
135
|
-
get idealHeight(): number;
|
|
136
|
-
set idealHeight(value: number);
|
|
137
|
-
/**
|
|
138
|
-
* Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
|
|
139
|
-
* @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
|
|
140
|
-
*/
|
|
141
|
-
get useSmallestIdeal(): boolean;
|
|
142
|
-
set useSmallestIdeal(value: boolean);
|
|
143
|
-
/**
|
|
144
|
-
* Gets or sets a boolean indicating if adaptive scaling must be used
|
|
145
|
-
* @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
|
|
146
|
-
*/
|
|
147
|
-
get renderAtIdealSize(): boolean;
|
|
148
|
-
set renderAtIdealSize(value: boolean);
|
|
149
|
-
/**
|
|
150
|
-
* Gets the ratio used when in "ideal mode"
|
|
151
|
-
* @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
|
|
152
|
-
* */
|
|
153
|
-
get idealRatio(): number;
|
|
154
|
-
/**
|
|
155
|
-
* Gets the underlying layer used to render the texture when in fullscreen mode
|
|
156
|
-
*/
|
|
157
|
-
get layer(): Nullable<Layer>;
|
|
158
|
-
/**
|
|
159
|
-
* Gets the root container control
|
|
160
|
-
*/
|
|
161
|
-
get rootContainer(): Container;
|
|
162
|
-
/**
|
|
163
|
-
* Returns an array containing the root container.
|
|
164
|
-
* This is mostly used to let the Inspector introspects the ADT
|
|
165
|
-
* @returns an array containing the rootContainer
|
|
166
|
-
*/
|
|
167
|
-
getChildren(): Array<Container>;
|
|
168
|
-
/**
|
|
169
|
-
* Will return all controls that are inside this texture
|
|
170
|
-
* @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
|
|
171
|
-
* @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
|
|
172
|
-
* @return all child controls
|
|
173
|
-
*/
|
|
174
|
-
getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[];
|
|
175
|
-
/**
|
|
176
|
-
* Will return all controls with the given type name
|
|
177
|
-
* @param typeName defines the type name to search for
|
|
178
|
-
* @returns an array of all controls found
|
|
179
|
-
*/
|
|
180
|
-
getControlsByType(typeName: string): Control[];
|
|
181
|
-
/**
|
|
182
|
-
* Will return the first control with the given name
|
|
183
|
-
* @param name defines the name to search for
|
|
184
|
-
* @return the first control found or null
|
|
185
|
-
*/
|
|
186
|
-
getControlByName(name: string): Nullable<Control>;
|
|
187
|
-
private _getControlByKey;
|
|
188
|
-
/**
|
|
189
|
-
* Gets or sets the current focused control
|
|
190
|
-
*/
|
|
191
|
-
get focusedControl(): Nullable<IFocusableControl>;
|
|
192
|
-
set focusedControl(control: Nullable<IFocusableControl>);
|
|
193
|
-
/**
|
|
194
|
-
* Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
|
|
195
|
-
*/
|
|
196
|
-
get isForeground(): boolean;
|
|
197
|
-
set isForeground(value: boolean);
|
|
198
|
-
/**
|
|
199
|
-
* Gets or set information about clipboardData
|
|
200
|
-
*/
|
|
201
|
-
get clipboardData(): string;
|
|
202
|
-
set clipboardData(value: string);
|
|
203
|
-
/**
|
|
204
|
-
* If set to true, every scene render will trigger a pointer event for the GUI
|
|
205
|
-
* if it is linked to a mesh or has controls linked to a mesh. This will allow
|
|
206
|
-
* you to catch the pointer moving around the GUI due to camera or mesh movements,
|
|
207
|
-
* but it has a performance cost.
|
|
208
|
-
*/
|
|
209
|
-
checkPointerEveryFrame: boolean;
|
|
210
|
-
/**
|
|
211
|
-
* Creates a new AdvancedDynamicTexture
|
|
212
|
-
* @param name defines the name of the texture
|
|
213
|
-
* @param width defines the width of the texture
|
|
214
|
-
* @param height defines the height of the texture
|
|
215
|
-
* @param scene defines the hosting scene
|
|
216
|
-
* @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
|
|
217
|
-
* @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
|
|
218
|
-
* @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
|
|
219
|
-
*/
|
|
220
|
-
constructor(name: string, width?: number, height?: number, scene?: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number, invertY?: boolean);
|
|
221
|
-
/**
|
|
222
|
-
* Get the current class name of the texture useful for serialization or dynamic coding.
|
|
223
|
-
* @returns "AdvancedDynamicTexture"
|
|
224
|
-
*/
|
|
225
|
-
getClassName(): string;
|
|
226
|
-
/**
|
|
227
|
-
* Function used to execute a function on all controls
|
|
228
|
-
* @param func defines the function to execute
|
|
229
|
-
* @param container defines the container where controls belong. If null the root container will be used
|
|
230
|
-
*/
|
|
231
|
-
executeOnAllControls(func: (control: Control) => void, container?: Container): void;
|
|
232
|
-
private _useInvalidateRectOptimization;
|
|
233
|
-
/**
|
|
234
|
-
* Gets or sets a boolean indicating if the InvalidateRect optimization should be turned on
|
|
235
|
-
*/
|
|
236
|
-
get useInvalidateRectOptimization(): boolean;
|
|
237
|
-
set useInvalidateRectOptimization(value: boolean);
|
|
238
|
-
private _invalidatedRectangle;
|
|
239
|
-
/**
|
|
240
|
-
* Invalidates a rectangle area on the gui texture
|
|
241
|
-
* @param invalidMinX left most position of the rectangle to invalidate in the texture
|
|
242
|
-
* @param invalidMinY top most position of the rectangle to invalidate in the texture
|
|
243
|
-
* @param invalidMaxX right most position of the rectangle to invalidate in the texture
|
|
244
|
-
* @param invalidMaxY bottom most position of the rectangle to invalidate in the texture
|
|
245
|
-
*/
|
|
246
|
-
invalidateRect(invalidMinX: number, invalidMinY: number, invalidMaxX: number, invalidMaxY: number): void;
|
|
247
|
-
/**
|
|
248
|
-
* Marks the texture as dirty forcing a complete update
|
|
249
|
-
*/
|
|
250
|
-
markAsDirty(): void;
|
|
251
|
-
/**
|
|
252
|
-
* Helper function used to create a new style
|
|
253
|
-
* @returns a new style
|
|
254
|
-
* @see https://doc.babylonjs.com/how_to/gui#styles
|
|
255
|
-
*/
|
|
256
|
-
createStyle(): Style;
|
|
257
|
-
/**
|
|
258
|
-
* Adds a new control to the root container
|
|
259
|
-
* @param control defines the control to add
|
|
260
|
-
* @returns the current texture
|
|
261
|
-
*/
|
|
262
|
-
addControl(control: Control): AdvancedDynamicTexture;
|
|
263
|
-
/**
|
|
264
|
-
* Removes a control from the root container
|
|
265
|
-
* @param control defines the control to remove
|
|
266
|
-
* @returns the current texture
|
|
267
|
-
*/
|
|
268
|
-
removeControl(control: Control): AdvancedDynamicTexture;
|
|
269
|
-
/**
|
|
270
|
-
* Moves overlapped controls towards a position where it is not overlapping anymore.
|
|
271
|
-
* Please note that this method alters linkOffsetXInPixels and linkOffsetYInPixels.
|
|
272
|
-
* @param overlapGroup the overlap group which will be processed or undefined to process all overlap groups
|
|
273
|
-
* @param deltaStep the step size (speed) to reach the target non overlapping position (default 0.1)
|
|
274
|
-
* @param repelFactor how much is the control repelled by other controls
|
|
275
|
-
*/
|
|
276
|
-
moveToNonOverlappedPosition(overlapGroup?: number | Control[], deltaStep?: number, repelFactor?: number): void;
|
|
277
|
-
/**
|
|
278
|
-
* Release all resources
|
|
279
|
-
*/
|
|
280
|
-
dispose(): void;
|
|
281
|
-
private _onResize;
|
|
282
|
-
/** @hidden */
|
|
283
|
-
_getGlobalViewport(): Viewport;
|
|
284
|
-
/**
|
|
285
|
-
* Get screen coordinates for a vector3
|
|
286
|
-
* @param position defines the position to project
|
|
287
|
-
* @param worldMatrix defines the world matrix to use
|
|
288
|
-
* @returns the projected position
|
|
289
|
-
*/
|
|
290
|
-
getProjectedPosition(position: Vector3, worldMatrix: Matrix): Vector2;
|
|
291
|
-
/**
|
|
292
|
-
* Get screen coordinates for a vector3
|
|
293
|
-
* @param position defines the position to project
|
|
294
|
-
* @param worldMatrix defines the world matrix to use
|
|
295
|
-
* @returns the projected position with Z
|
|
296
|
-
*/
|
|
297
|
-
getProjectedPositionWithZ(position: Vector3, worldMatrix: Matrix): Vector3;
|
|
298
|
-
private _checkUpdate;
|
|
299
|
-
private _clearMeasure;
|
|
300
|
-
private _render;
|
|
301
|
-
/**
|
|
302
|
-
* @param cursor
|
|
303
|
-
* @hidden
|
|
304
|
-
*/
|
|
305
|
-
_changeCursor(cursor: string): void;
|
|
306
|
-
/**
|
|
307
|
-
* @param control
|
|
308
|
-
* @param pointerId
|
|
309
|
-
* @hidden
|
|
310
|
-
*/
|
|
311
|
-
_registerLastControlDown(control: Control, pointerId: number): void;
|
|
312
|
-
private _doPicking;
|
|
313
|
-
/**
|
|
314
|
-
* @param list
|
|
315
|
-
* @param control
|
|
316
|
-
* @hidden
|
|
317
|
-
*/
|
|
318
|
-
_cleanControlAfterRemovalFromList(list: {
|
|
319
|
-
[pointerId: number]: Control;
|
|
320
|
-
}, control: Control): void;
|
|
321
|
-
/**
|
|
322
|
-
* @param control
|
|
323
|
-
* @hidden
|
|
324
|
-
*/
|
|
325
|
-
_cleanControlAfterRemoval(control: Control): void;
|
|
326
|
-
private _translateToPicking;
|
|
327
|
-
/** Attach to all scene events required to support pointer events */
|
|
328
|
-
attach(): void;
|
|
329
|
-
/**
|
|
330
|
-
* @param rawEvt
|
|
331
|
-
* @hidden
|
|
332
|
-
*/
|
|
333
|
-
private _onClipboardCopy;
|
|
334
|
-
/**
|
|
335
|
-
* @param rawEvt
|
|
336
|
-
* @hidden
|
|
337
|
-
*/
|
|
338
|
-
private _onClipboardCut;
|
|
339
|
-
/**
|
|
340
|
-
* @param rawEvt
|
|
341
|
-
* @hidden
|
|
342
|
-
*/
|
|
343
|
-
private _onClipboardPaste;
|
|
344
|
-
/**
|
|
345
|
-
* Register the clipboard Events onto the canvas
|
|
346
|
-
*/
|
|
347
|
-
registerClipboardEvents(): void;
|
|
348
|
-
/**
|
|
349
|
-
* Unregister the clipboard Events from the canvas
|
|
350
|
-
*/
|
|
351
|
-
unRegisterClipboardEvents(): void;
|
|
352
|
-
/**
|
|
353
|
-
* Connect the texture to a hosting mesh to enable interactions
|
|
354
|
-
* @param mesh defines the mesh to attach to
|
|
355
|
-
* @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
|
|
356
|
-
*/
|
|
357
|
-
attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
|
|
358
|
-
/**
|
|
359
|
-
* Move the focus to a specific control
|
|
360
|
-
* @param control defines the control which will receive the focus
|
|
361
|
-
*/
|
|
362
|
-
moveFocusToControl(control: IFocusableControl): void;
|
|
363
|
-
private _manageFocus;
|
|
364
|
-
private _attachPickingToSceneRender;
|
|
365
|
-
private _attachToOnPointerOut;
|
|
366
|
-
private _attachToOnBlur;
|
|
367
|
-
/**
|
|
368
|
-
* Serializes the entire GUI system
|
|
369
|
-
* @returns an object with the JSON serialized data
|
|
370
|
-
*/
|
|
371
|
-
serializeContent(): any;
|
|
372
|
-
/**
|
|
373
|
-
* Recreate the content of the ADT from a JSON object
|
|
374
|
-
* @param serializedObject define the JSON serialized object to restore from
|
|
375
|
-
* @param scaleToSize defines whether to scale to texture to the saved size
|
|
376
|
-
*/
|
|
377
|
-
parseContent(serializedObject: any, scaleToSize?: boolean): void;
|
|
378
|
-
/**
|
|
379
|
-
* Recreate the content of the ADT from a snippet saved by the GUI editor
|
|
380
|
-
* @param snippetId defines the snippet to load
|
|
381
|
-
* @param scaleToSize defines whether to scale to texture to the saved size
|
|
382
|
-
* @returns a promise that will resolve on success
|
|
383
|
-
*/
|
|
384
|
-
parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean): Promise<void>;
|
|
385
|
-
/**
|
|
386
|
-
* Recreate the content of the ADT from a url json
|
|
387
|
-
* @param url defines the url to load
|
|
388
|
-
* @param scaleToSize defines whether to scale to texture to the saved size
|
|
389
|
-
* @returns a promise that will resolve on success
|
|
390
|
-
*/
|
|
391
|
-
parseFromURLAsync(url: string, scaleToSize?: boolean): Promise<void>;
|
|
392
|
-
/**
|
|
393
|
-
* Compares two rectangle based controls for pixel overlap
|
|
394
|
-
* @param control1 The first control to compare
|
|
395
|
-
* @param control2 The second control to compare
|
|
396
|
-
* @returns true if overlaps, otherwise false
|
|
397
|
-
*/
|
|
398
|
-
private static _Overlaps;
|
|
399
|
-
/**
|
|
400
|
-
* Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
|
|
401
|
-
* @param mesh defines the mesh which will receive the texture
|
|
402
|
-
* @param width defines the texture width (1024 by default)
|
|
403
|
-
* @param height defines the texture height (1024 by default)
|
|
404
|
-
* @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
|
|
405
|
-
* @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)
|
|
406
|
-
* @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
|
|
407
|
-
* @param materialSetupCallback defines a custom way of creating and setting up the material on the mesh
|
|
408
|
-
* @returns a new AdvancedDynamicTexture
|
|
409
|
-
*/
|
|
410
|
-
static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean, invertY?: boolean, materialSetupCallback?: (mesh: AbstractMesh, uniqueId: string, texture: AdvancedDynamicTexture, onlyAlphaTesting: boolean) => void): AdvancedDynamicTexture;
|
|
411
|
-
private static _CreateMaterial;
|
|
412
|
-
/**
|
|
413
|
-
* Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) BUT do not create a new material for the mesh. You will be responsible for connecting the texture
|
|
414
|
-
* @param mesh defines the mesh which will receive the texture
|
|
415
|
-
* @param width defines the texture width (1024 by default)
|
|
416
|
-
* @param height defines the texture height (1024 by default)
|
|
417
|
-
* @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
|
|
418
|
-
* @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
|
|
419
|
-
* @returns a new AdvancedDynamicTexture
|
|
420
|
-
*/
|
|
421
|
-
static CreateForMeshTexture(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, invertY?: boolean): AdvancedDynamicTexture;
|
|
422
|
-
/**
|
|
423
|
-
* Creates a new AdvancedDynamicTexture in fullscreen mode.
|
|
424
|
-
* In this mode the texture will rely on a layer for its rendering.
|
|
425
|
-
* This allows it to be treated like any other layer.
|
|
426
|
-
* As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
|
|
427
|
-
* LayerMask is set through advancedTexture.layer.layerMask
|
|
428
|
-
* @param name defines name for the texture
|
|
429
|
-
* @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
|
|
430
|
-
* @param scene defines the hosting scene
|
|
431
|
-
* @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
|
|
432
|
-
* @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)
|
|
433
|
-
* @returns a new AdvancedDynamicTexture
|
|
434
|
-
*/
|
|
435
|
-
static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number, adaptiveScaling?: boolean): AdvancedDynamicTexture;
|
|
436
|
-
/**
|
|
437
|
-
* Scales the texture
|
|
438
|
-
* @param ratio the scale factor to apply to both width and height
|
|
439
|
-
*/
|
|
440
|
-
scale(ratio: number): void;
|
|
441
|
-
/**
|
|
442
|
-
* Resizes the texture
|
|
443
|
-
* @param width the new width
|
|
444
|
-
* @param height the new height
|
|
445
|
-
*/
|
|
446
|
-
scaleTo(width: number, height: number): void;
|
|
447
|
-
}
|
|
448
|
-
export { IFocusableControl };
|
|
1
|
+
import { Nullable } from "@babylonjs/core/types.js";
|
|
2
|
+
import { Observable } from "@babylonjs/core/Misc/observable.js";
|
|
3
|
+
import { Vector2, Vector3, Matrix } from "@babylonjs/core/Maths/math.vector.js";
|
|
4
|
+
import { ClipboardInfo } from "@babylonjs/core/Events/clipboardEvents.js";
|
|
5
|
+
import { DynamicTexture } from "@babylonjs/core/Materials/Textures/dynamicTexture.js";
|
|
6
|
+
import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
|
|
7
|
+
import { Layer } from "@babylonjs/core/Layers/layer.js";
|
|
8
|
+
import { Scene } from "@babylonjs/core/scene.js";
|
|
9
|
+
import { Container } from "./controls/container";
|
|
10
|
+
import { Control } from "./controls/control";
|
|
11
|
+
import { IFocusableControl } from "./controls/focusableControl";
|
|
12
|
+
import { Style } from "./style";
|
|
13
|
+
import { Viewport } from "@babylonjs/core/Maths/math.viewport.js";
|
|
14
|
+
/**
|
|
15
|
+
* Class used to create texture to support 2D GUI elements
|
|
16
|
+
* @see https://doc.babylonjs.com/how_to/gui
|
|
17
|
+
*/
|
|
18
|
+
export declare class AdvancedDynamicTexture extends DynamicTexture {
|
|
19
|
+
/** Define the Uurl to load snippets */
|
|
20
|
+
static SnippetUrl: string;
|
|
21
|
+
/** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */
|
|
22
|
+
static AllowGPUOptimizations: boolean;
|
|
23
|
+
/** Snippet ID if the content was created from the snippet server */
|
|
24
|
+
snippetId: string;
|
|
25
|
+
private _isDirty;
|
|
26
|
+
private _renderObserver;
|
|
27
|
+
private _resizeObserver;
|
|
28
|
+
private _preKeyboardObserver;
|
|
29
|
+
private _pointerMoveObserver;
|
|
30
|
+
private _sceneRenderObserver;
|
|
31
|
+
private _pointerObserver;
|
|
32
|
+
private _canvasPointerOutObserver;
|
|
33
|
+
private _canvasBlurObserver;
|
|
34
|
+
private _background;
|
|
35
|
+
/** @hidden */
|
|
36
|
+
_rootContainer: Container;
|
|
37
|
+
/** @hidden */
|
|
38
|
+
_lastPickedControl: Control;
|
|
39
|
+
/** @hidden */
|
|
40
|
+
_lastControlOver: {
|
|
41
|
+
[pointerId: number]: Control;
|
|
42
|
+
};
|
|
43
|
+
/** @hidden */
|
|
44
|
+
_lastControlDown: {
|
|
45
|
+
[pointerId: number]: Control;
|
|
46
|
+
};
|
|
47
|
+
/** @hidden */
|
|
48
|
+
_capturingControl: {
|
|
49
|
+
[pointerId: number]: Control;
|
|
50
|
+
};
|
|
51
|
+
/** @hidden */
|
|
52
|
+
_shouldBlockPointer: boolean;
|
|
53
|
+
/** @hidden */
|
|
54
|
+
_layerToDispose: Nullable<Layer>;
|
|
55
|
+
/** @hidden */
|
|
56
|
+
_linkedControls: Control[];
|
|
57
|
+
private _isFullscreen;
|
|
58
|
+
private _fullscreenViewport;
|
|
59
|
+
private _idealWidth;
|
|
60
|
+
private _idealHeight;
|
|
61
|
+
private _useSmallestIdeal;
|
|
62
|
+
private _renderAtIdealSize;
|
|
63
|
+
private _focusedControl;
|
|
64
|
+
private _blockNextFocusCheck;
|
|
65
|
+
private _renderScale;
|
|
66
|
+
private _rootElement;
|
|
67
|
+
private _cursorChanged;
|
|
68
|
+
private _defaultMousePointerId;
|
|
69
|
+
/** @hidden */
|
|
70
|
+
_numLayoutCalls: number;
|
|
71
|
+
/** Gets the number of layout calls made the last time the ADT has been rendered */
|
|
72
|
+
get numLayoutCalls(): number;
|
|
73
|
+
/** @hidden */
|
|
74
|
+
_numRenderCalls: number;
|
|
75
|
+
/** Gets the number of render calls made the last time the ADT has been rendered */
|
|
76
|
+
get numRenderCalls(): number;
|
|
77
|
+
/**
|
|
78
|
+
* Define type to string to ensure compatibility across browsers
|
|
79
|
+
* Safari doesn't support DataTransfer constructor
|
|
80
|
+
*/
|
|
81
|
+
private _clipboardData;
|
|
82
|
+
/**
|
|
83
|
+
* Observable event triggered each time an clipboard event is received from the rendering canvas
|
|
84
|
+
*/
|
|
85
|
+
onClipboardObservable: Observable<ClipboardInfo>;
|
|
86
|
+
/**
|
|
87
|
+
* Observable event triggered each time a pointer down is intercepted by a control
|
|
88
|
+
*/
|
|
89
|
+
onControlPickedObservable: Observable<Control>;
|
|
90
|
+
/**
|
|
91
|
+
* Observable event triggered before layout is evaluated
|
|
92
|
+
*/
|
|
93
|
+
onBeginLayoutObservable: Observable<AdvancedDynamicTexture>;
|
|
94
|
+
/**
|
|
95
|
+
* Observable event triggered after the layout was evaluated
|
|
96
|
+
*/
|
|
97
|
+
onEndLayoutObservable: Observable<AdvancedDynamicTexture>;
|
|
98
|
+
/**
|
|
99
|
+
* Observable event triggered before the texture is rendered
|
|
100
|
+
*/
|
|
101
|
+
onBeginRenderObservable: Observable<AdvancedDynamicTexture>;
|
|
102
|
+
/**
|
|
103
|
+
* Observable event triggered after the texture was rendered
|
|
104
|
+
*/
|
|
105
|
+
onEndRenderObservable: Observable<AdvancedDynamicTexture>;
|
|
106
|
+
/**
|
|
107
|
+
* Gets or sets a boolean defining if alpha is stored as premultiplied
|
|
108
|
+
*/
|
|
109
|
+
premulAlpha: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture
|
|
112
|
+
*/
|
|
113
|
+
applyYInversionOnUpdate: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
|
|
116
|
+
* Useful when you want more antialiasing
|
|
117
|
+
*/
|
|
118
|
+
get renderScale(): number;
|
|
119
|
+
set renderScale(value: number);
|
|
120
|
+
/** Gets or sets the background color */
|
|
121
|
+
get background(): string;
|
|
122
|
+
set background(value: string);
|
|
123
|
+
/**
|
|
124
|
+
* Gets or sets the ideal width used to design controls.
|
|
125
|
+
* The GUI will then rescale everything accordingly
|
|
126
|
+
* @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
|
|
127
|
+
*/
|
|
128
|
+
get idealWidth(): number;
|
|
129
|
+
set idealWidth(value: number);
|
|
130
|
+
/**
|
|
131
|
+
* Gets or sets the ideal height used to design controls.
|
|
132
|
+
* The GUI will then rescale everything accordingly
|
|
133
|
+
* @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
|
|
134
|
+
*/
|
|
135
|
+
get idealHeight(): number;
|
|
136
|
+
set idealHeight(value: number);
|
|
137
|
+
/**
|
|
138
|
+
* Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
|
|
139
|
+
* @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
|
|
140
|
+
*/
|
|
141
|
+
get useSmallestIdeal(): boolean;
|
|
142
|
+
set useSmallestIdeal(value: boolean);
|
|
143
|
+
/**
|
|
144
|
+
* Gets or sets a boolean indicating if adaptive scaling must be used
|
|
145
|
+
* @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
|
|
146
|
+
*/
|
|
147
|
+
get renderAtIdealSize(): boolean;
|
|
148
|
+
set renderAtIdealSize(value: boolean);
|
|
149
|
+
/**
|
|
150
|
+
* Gets the ratio used when in "ideal mode"
|
|
151
|
+
* @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
|
|
152
|
+
* */
|
|
153
|
+
get idealRatio(): number;
|
|
154
|
+
/**
|
|
155
|
+
* Gets the underlying layer used to render the texture when in fullscreen mode
|
|
156
|
+
*/
|
|
157
|
+
get layer(): Nullable<Layer>;
|
|
158
|
+
/**
|
|
159
|
+
* Gets the root container control
|
|
160
|
+
*/
|
|
161
|
+
get rootContainer(): Container;
|
|
162
|
+
/**
|
|
163
|
+
* Returns an array containing the root container.
|
|
164
|
+
* This is mostly used to let the Inspector introspects the ADT
|
|
165
|
+
* @returns an array containing the rootContainer
|
|
166
|
+
*/
|
|
167
|
+
getChildren(): Array<Container>;
|
|
168
|
+
/**
|
|
169
|
+
* Will return all controls that are inside this texture
|
|
170
|
+
* @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
|
|
171
|
+
* @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
|
|
172
|
+
* @return all child controls
|
|
173
|
+
*/
|
|
174
|
+
getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[];
|
|
175
|
+
/**
|
|
176
|
+
* Will return all controls with the given type name
|
|
177
|
+
* @param typeName defines the type name to search for
|
|
178
|
+
* @returns an array of all controls found
|
|
179
|
+
*/
|
|
180
|
+
getControlsByType(typeName: string): Control[];
|
|
181
|
+
/**
|
|
182
|
+
* Will return the first control with the given name
|
|
183
|
+
* @param name defines the name to search for
|
|
184
|
+
* @return the first control found or null
|
|
185
|
+
*/
|
|
186
|
+
getControlByName(name: string): Nullable<Control>;
|
|
187
|
+
private _getControlByKey;
|
|
188
|
+
/**
|
|
189
|
+
* Gets or sets the current focused control
|
|
190
|
+
*/
|
|
191
|
+
get focusedControl(): Nullable<IFocusableControl>;
|
|
192
|
+
set focusedControl(control: Nullable<IFocusableControl>);
|
|
193
|
+
/**
|
|
194
|
+
* Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
|
|
195
|
+
*/
|
|
196
|
+
get isForeground(): boolean;
|
|
197
|
+
set isForeground(value: boolean);
|
|
198
|
+
/**
|
|
199
|
+
* Gets or set information about clipboardData
|
|
200
|
+
*/
|
|
201
|
+
get clipboardData(): string;
|
|
202
|
+
set clipboardData(value: string);
|
|
203
|
+
/**
|
|
204
|
+
* If set to true, every scene render will trigger a pointer event for the GUI
|
|
205
|
+
* if it is linked to a mesh or has controls linked to a mesh. This will allow
|
|
206
|
+
* you to catch the pointer moving around the GUI due to camera or mesh movements,
|
|
207
|
+
* but it has a performance cost.
|
|
208
|
+
*/
|
|
209
|
+
checkPointerEveryFrame: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Creates a new AdvancedDynamicTexture
|
|
212
|
+
* @param name defines the name of the texture
|
|
213
|
+
* @param width defines the width of the texture
|
|
214
|
+
* @param height defines the height of the texture
|
|
215
|
+
* @param scene defines the hosting scene
|
|
216
|
+
* @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
|
|
217
|
+
* @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
|
|
218
|
+
* @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
|
|
219
|
+
*/
|
|
220
|
+
constructor(name: string, width?: number, height?: number, scene?: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number, invertY?: boolean);
|
|
221
|
+
/**
|
|
222
|
+
* Get the current class name of the texture useful for serialization or dynamic coding.
|
|
223
|
+
* @returns "AdvancedDynamicTexture"
|
|
224
|
+
*/
|
|
225
|
+
getClassName(): string;
|
|
226
|
+
/**
|
|
227
|
+
* Function used to execute a function on all controls
|
|
228
|
+
* @param func defines the function to execute
|
|
229
|
+
* @param container defines the container where controls belong. If null the root container will be used
|
|
230
|
+
*/
|
|
231
|
+
executeOnAllControls(func: (control: Control) => void, container?: Container): void;
|
|
232
|
+
private _useInvalidateRectOptimization;
|
|
233
|
+
/**
|
|
234
|
+
* Gets or sets a boolean indicating if the InvalidateRect optimization should be turned on
|
|
235
|
+
*/
|
|
236
|
+
get useInvalidateRectOptimization(): boolean;
|
|
237
|
+
set useInvalidateRectOptimization(value: boolean);
|
|
238
|
+
private _invalidatedRectangle;
|
|
239
|
+
/**
|
|
240
|
+
* Invalidates a rectangle area on the gui texture
|
|
241
|
+
* @param invalidMinX left most position of the rectangle to invalidate in the texture
|
|
242
|
+
* @param invalidMinY top most position of the rectangle to invalidate in the texture
|
|
243
|
+
* @param invalidMaxX right most position of the rectangle to invalidate in the texture
|
|
244
|
+
* @param invalidMaxY bottom most position of the rectangle to invalidate in the texture
|
|
245
|
+
*/
|
|
246
|
+
invalidateRect(invalidMinX: number, invalidMinY: number, invalidMaxX: number, invalidMaxY: number): void;
|
|
247
|
+
/**
|
|
248
|
+
* Marks the texture as dirty forcing a complete update
|
|
249
|
+
*/
|
|
250
|
+
markAsDirty(): void;
|
|
251
|
+
/**
|
|
252
|
+
* Helper function used to create a new style
|
|
253
|
+
* @returns a new style
|
|
254
|
+
* @see https://doc.babylonjs.com/how_to/gui#styles
|
|
255
|
+
*/
|
|
256
|
+
createStyle(): Style;
|
|
257
|
+
/**
|
|
258
|
+
* Adds a new control to the root container
|
|
259
|
+
* @param control defines the control to add
|
|
260
|
+
* @returns the current texture
|
|
261
|
+
*/
|
|
262
|
+
addControl(control: Control): AdvancedDynamicTexture;
|
|
263
|
+
/**
|
|
264
|
+
* Removes a control from the root container
|
|
265
|
+
* @param control defines the control to remove
|
|
266
|
+
* @returns the current texture
|
|
267
|
+
*/
|
|
268
|
+
removeControl(control: Control): AdvancedDynamicTexture;
|
|
269
|
+
/**
|
|
270
|
+
* Moves overlapped controls towards a position where it is not overlapping anymore.
|
|
271
|
+
* Please note that this method alters linkOffsetXInPixels and linkOffsetYInPixels.
|
|
272
|
+
* @param overlapGroup the overlap group which will be processed or undefined to process all overlap groups
|
|
273
|
+
* @param deltaStep the step size (speed) to reach the target non overlapping position (default 0.1)
|
|
274
|
+
* @param repelFactor how much is the control repelled by other controls
|
|
275
|
+
*/
|
|
276
|
+
moveToNonOverlappedPosition(overlapGroup?: number | Control[], deltaStep?: number, repelFactor?: number): void;
|
|
277
|
+
/**
|
|
278
|
+
* Release all resources
|
|
279
|
+
*/
|
|
280
|
+
dispose(): void;
|
|
281
|
+
private _onResize;
|
|
282
|
+
/** @hidden */
|
|
283
|
+
_getGlobalViewport(): Viewport;
|
|
284
|
+
/**
|
|
285
|
+
* Get screen coordinates for a vector3
|
|
286
|
+
* @param position defines the position to project
|
|
287
|
+
* @param worldMatrix defines the world matrix to use
|
|
288
|
+
* @returns the projected position
|
|
289
|
+
*/
|
|
290
|
+
getProjectedPosition(position: Vector3, worldMatrix: Matrix): Vector2;
|
|
291
|
+
/**
|
|
292
|
+
* Get screen coordinates for a vector3
|
|
293
|
+
* @param position defines the position to project
|
|
294
|
+
* @param worldMatrix defines the world matrix to use
|
|
295
|
+
* @returns the projected position with Z
|
|
296
|
+
*/
|
|
297
|
+
getProjectedPositionWithZ(position: Vector3, worldMatrix: Matrix): Vector3;
|
|
298
|
+
private _checkUpdate;
|
|
299
|
+
private _clearMeasure;
|
|
300
|
+
private _render;
|
|
301
|
+
/**
|
|
302
|
+
* @param cursor
|
|
303
|
+
* @hidden
|
|
304
|
+
*/
|
|
305
|
+
_changeCursor(cursor: string): void;
|
|
306
|
+
/**
|
|
307
|
+
* @param control
|
|
308
|
+
* @param pointerId
|
|
309
|
+
* @hidden
|
|
310
|
+
*/
|
|
311
|
+
_registerLastControlDown(control: Control, pointerId: number): void;
|
|
312
|
+
private _doPicking;
|
|
313
|
+
/**
|
|
314
|
+
* @param list
|
|
315
|
+
* @param control
|
|
316
|
+
* @hidden
|
|
317
|
+
*/
|
|
318
|
+
_cleanControlAfterRemovalFromList(list: {
|
|
319
|
+
[pointerId: number]: Control;
|
|
320
|
+
}, control: Control): void;
|
|
321
|
+
/**
|
|
322
|
+
* @param control
|
|
323
|
+
* @hidden
|
|
324
|
+
*/
|
|
325
|
+
_cleanControlAfterRemoval(control: Control): void;
|
|
326
|
+
private _translateToPicking;
|
|
327
|
+
/** Attach to all scene events required to support pointer events */
|
|
328
|
+
attach(): void;
|
|
329
|
+
/**
|
|
330
|
+
* @param rawEvt
|
|
331
|
+
* @hidden
|
|
332
|
+
*/
|
|
333
|
+
private _onClipboardCopy;
|
|
334
|
+
/**
|
|
335
|
+
* @param rawEvt
|
|
336
|
+
* @hidden
|
|
337
|
+
*/
|
|
338
|
+
private _onClipboardCut;
|
|
339
|
+
/**
|
|
340
|
+
* @param rawEvt
|
|
341
|
+
* @hidden
|
|
342
|
+
*/
|
|
343
|
+
private _onClipboardPaste;
|
|
344
|
+
/**
|
|
345
|
+
* Register the clipboard Events onto the canvas
|
|
346
|
+
*/
|
|
347
|
+
registerClipboardEvents(): void;
|
|
348
|
+
/**
|
|
349
|
+
* Unregister the clipboard Events from the canvas
|
|
350
|
+
*/
|
|
351
|
+
unRegisterClipboardEvents(): void;
|
|
352
|
+
/**
|
|
353
|
+
* Connect the texture to a hosting mesh to enable interactions
|
|
354
|
+
* @param mesh defines the mesh to attach to
|
|
355
|
+
* @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
|
|
356
|
+
*/
|
|
357
|
+
attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
|
|
358
|
+
/**
|
|
359
|
+
* Move the focus to a specific control
|
|
360
|
+
* @param control defines the control which will receive the focus
|
|
361
|
+
*/
|
|
362
|
+
moveFocusToControl(control: IFocusableControl): void;
|
|
363
|
+
private _manageFocus;
|
|
364
|
+
private _attachPickingToSceneRender;
|
|
365
|
+
private _attachToOnPointerOut;
|
|
366
|
+
private _attachToOnBlur;
|
|
367
|
+
/**
|
|
368
|
+
* Serializes the entire GUI system
|
|
369
|
+
* @returns an object with the JSON serialized data
|
|
370
|
+
*/
|
|
371
|
+
serializeContent(): any;
|
|
372
|
+
/**
|
|
373
|
+
* Recreate the content of the ADT from a JSON object
|
|
374
|
+
* @param serializedObject define the JSON serialized object to restore from
|
|
375
|
+
* @param scaleToSize defines whether to scale to texture to the saved size
|
|
376
|
+
*/
|
|
377
|
+
parseContent(serializedObject: any, scaleToSize?: boolean): void;
|
|
378
|
+
/**
|
|
379
|
+
* Recreate the content of the ADT from a snippet saved by the GUI editor
|
|
380
|
+
* @param snippetId defines the snippet to load
|
|
381
|
+
* @param scaleToSize defines whether to scale to texture to the saved size
|
|
382
|
+
* @returns a promise that will resolve on success
|
|
383
|
+
*/
|
|
384
|
+
parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean): Promise<void>;
|
|
385
|
+
/**
|
|
386
|
+
* Recreate the content of the ADT from a url json
|
|
387
|
+
* @param url defines the url to load
|
|
388
|
+
* @param scaleToSize defines whether to scale to texture to the saved size
|
|
389
|
+
* @returns a promise that will resolve on success
|
|
390
|
+
*/
|
|
391
|
+
parseFromURLAsync(url: string, scaleToSize?: boolean): Promise<void>;
|
|
392
|
+
/**
|
|
393
|
+
* Compares two rectangle based controls for pixel overlap
|
|
394
|
+
* @param control1 The first control to compare
|
|
395
|
+
* @param control2 The second control to compare
|
|
396
|
+
* @returns true if overlaps, otherwise false
|
|
397
|
+
*/
|
|
398
|
+
private static _Overlaps;
|
|
399
|
+
/**
|
|
400
|
+
* Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
|
|
401
|
+
* @param mesh defines the mesh which will receive the texture
|
|
402
|
+
* @param width defines the texture width (1024 by default)
|
|
403
|
+
* @param height defines the texture height (1024 by default)
|
|
404
|
+
* @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
|
|
405
|
+
* @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)
|
|
406
|
+
* @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
|
|
407
|
+
* @param materialSetupCallback defines a custom way of creating and setting up the material on the mesh
|
|
408
|
+
* @returns a new AdvancedDynamicTexture
|
|
409
|
+
*/
|
|
410
|
+
static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean, invertY?: boolean, materialSetupCallback?: (mesh: AbstractMesh, uniqueId: string, texture: AdvancedDynamicTexture, onlyAlphaTesting: boolean) => void): AdvancedDynamicTexture;
|
|
411
|
+
private static _CreateMaterial;
|
|
412
|
+
/**
|
|
413
|
+
* Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) BUT do not create a new material for the mesh. You will be responsible for connecting the texture
|
|
414
|
+
* @param mesh defines the mesh which will receive the texture
|
|
415
|
+
* @param width defines the texture width (1024 by default)
|
|
416
|
+
* @param height defines the texture height (1024 by default)
|
|
417
|
+
* @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
|
|
418
|
+
* @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
|
|
419
|
+
* @returns a new AdvancedDynamicTexture
|
|
420
|
+
*/
|
|
421
|
+
static CreateForMeshTexture(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, invertY?: boolean): AdvancedDynamicTexture;
|
|
422
|
+
/**
|
|
423
|
+
* Creates a new AdvancedDynamicTexture in fullscreen mode.
|
|
424
|
+
* In this mode the texture will rely on a layer for its rendering.
|
|
425
|
+
* This allows it to be treated like any other layer.
|
|
426
|
+
* As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
|
|
427
|
+
* LayerMask is set through advancedTexture.layer.layerMask
|
|
428
|
+
* @param name defines name for the texture
|
|
429
|
+
* @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
|
|
430
|
+
* @param scene defines the hosting scene
|
|
431
|
+
* @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
|
|
432
|
+
* @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)
|
|
433
|
+
* @returns a new AdvancedDynamicTexture
|
|
434
|
+
*/
|
|
435
|
+
static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number, adaptiveScaling?: boolean): AdvancedDynamicTexture;
|
|
436
|
+
/**
|
|
437
|
+
* Scales the texture
|
|
438
|
+
* @param ratio the scale factor to apply to both width and height
|
|
439
|
+
*/
|
|
440
|
+
scale(ratio: number): void;
|
|
441
|
+
/**
|
|
442
|
+
* Resizes the texture
|
|
443
|
+
* @param width the new width
|
|
444
|
+
* @param height the new height
|
|
445
|
+
*/
|
|
446
|
+
scaleTo(width: number, height: number): void;
|
|
447
|
+
}
|
|
448
|
+
export { IFocusableControl };
|