@babylonjs/gui 5.0.0-rc.6 → 5.0.0

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