@babylonjs/gui 5.0.0-rc.0 → 5.0.0-rc.11

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 (305) 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 -423
  5. package/2D/advancedDynamicTexture.js +1318 -1286
  6. package/2D/advancedDynamicTexture.js.map +1 -1
  7. package/2D/controls/button.d.ts +135 -97
  8. package/2D/controls/button.js +276 -238
  9. package/2D/controls/button.js.map +1 -1
  10. package/2D/controls/checkbox.d.ts +59 -51
  11. package/2D/controls/checkbox.js +188 -178
  12. package/2D/controls/checkbox.js.map +1 -1
  13. package/2D/controls/colorpicker.d.ts +103 -90
  14. package/2D/controls/colorpicker.js +1417 -1400
  15. package/2D/controls/colorpicker.js.map +1 -1
  16. package/2D/controls/container.d.ts +175 -130
  17. package/2D/controls/container.js +570 -525
  18. package/2D/controls/container.js.map +1 -1
  19. package/2D/controls/control.d.ts +866 -743
  20. package/2D/controls/control.js +2433 -2308
  21. package/2D/controls/control.js.map +1 -1
  22. package/2D/controls/displayGrid.d.ts +53 -55
  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 -52
  29. package/2D/controls/focusableButton.js +99 -92
  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 -135
  35. package/2D/controls/grid.js +529 -525
  36. package/2D/controls/grid.js.map +1 -1
  37. package/2D/controls/image.d.ts +204 -197
  38. package/2D/controls/image.js +887 -879
  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/index.js.map +1 -1
  43. package/2D/controls/inputPassword.d.ts +9 -8
  44. package/2D/controls/inputPassword.js +28 -25
  45. package/2D/controls/inputPassword.js.map +1 -1
  46. package/2D/controls/inputText.d.ts +201 -182
  47. package/2D/controls/inputText.js +1119 -1096
  48. package/2D/controls/inputText.js.map +1 -1
  49. package/2D/controls/line.d.ts +66 -66
  50. package/2D/controls/line.js +271 -271
  51. package/2D/controls/line.js.map +1 -1
  52. package/2D/controls/multiLine.d.ts +75 -77
  53. package/2D/controls/multiLine.js +262 -262
  54. package/2D/controls/multiLine.js.map +1 -1
  55. package/2D/controls/radioButton.d.ts +49 -49
  56. package/2D/controls/radioButton.js +205 -205
  57. package/2D/controls/radioButton.js.map +1 -1
  58. package/2D/controls/rectangle.d.ts +29 -29
  59. package/2D/controls/rectangle.js +150 -150
  60. package/2D/controls/rectangle.js.map +1 -1
  61. package/2D/controls/scrollViewers/scrollViewer.d.ts +182 -175
  62. package/2D/controls/scrollViewers/scrollViewer.js +677 -676
  63. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
  64. package/2D/controls/scrollViewers/scrollViewerWindow.d.ts +57 -45
  65. package/2D/controls/scrollViewers/scrollViewerWindow.js +278 -263
  66. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
  67. package/2D/controls/selector.d.ts +263 -209
  68. package/2D/controls/selector.js +692 -629
  69. package/2D/controls/selector.js.map +1 -1
  70. package/2D/controls/sliders/baseSlider.d.ts +82 -78
  71. package/2D/controls/sliders/baseSlider.js +347 -343
  72. package/2D/controls/sliders/baseSlider.js.map +1 -1
  73. package/2D/controls/sliders/imageBasedSlider.d.ts +49 -47
  74. package/2D/controls/sliders/imageBasedSlider.js +192 -188
  75. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  76. package/2D/controls/sliders/imageScrollBar.d.ts +65 -61
  77. package/2D/controls/sliders/imageScrollBar.js +263 -256
  78. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  79. package/2D/controls/sliders/scrollBar.d.ts +38 -34
  80. package/2D/controls/sliders/scrollBar.js +143 -136
  81. package/2D/controls/sliders/scrollBar.js.map +1 -1
  82. package/2D/controls/sliders/slider.d.ts +35 -37
  83. package/2D/controls/sliders/slider.js +271 -271
  84. package/2D/controls/sliders/slider.js.map +1 -1
  85. package/2D/controls/stackPanel.d.ts +64 -56
  86. package/2D/controls/stackPanel.js +246 -236
  87. package/2D/controls/stackPanel.js.map +1 -1
  88. package/2D/controls/statics.d.ts +6 -6
  89. package/2D/controls/statics.js +49 -47
  90. package/2D/controls/statics.js.map +1 -1
  91. package/2D/controls/textBlock.d.ts +175 -172
  92. package/2D/controls/textBlock.js +603 -598
  93. package/2D/controls/textBlock.js.map +1 -1
  94. package/2D/controls/textWrapper.d.ts +13 -13
  95. package/2D/controls/textWrapper.js +101 -101
  96. package/2D/controls/textWrapper.js.map +1 -1
  97. package/2D/controls/toggleButton.d.ts +117 -83
  98. package/2D/controls/toggleButton.js +268 -234
  99. package/2D/controls/toggleButton.js.map +1 -1
  100. package/2D/controls/virtualKeyboard.d.ts +96 -96
  101. package/2D/controls/virtualKeyboard.js +256 -256
  102. package/2D/controls/virtualKeyboard.js.map +1 -1
  103. package/2D/index.d.ts +9 -9
  104. package/2D/index.js +10 -9
  105. package/2D/index.js.map +1 -1
  106. package/2D/math2D.d.ts +117 -117
  107. package/2D/math2D.js +221 -221
  108. package/2D/math2D.js.map +1 -1
  109. package/2D/measure.d.ts +77 -77
  110. package/2D/measure.js +139 -149
  111. package/2D/measure.js.map +1 -1
  112. package/2D/multiLinePoint.d.ts +47 -47
  113. package/2D/multiLinePoint.js +127 -127
  114. package/2D/multiLinePoint.js.map +1 -1
  115. package/2D/style.d.ts +46 -46
  116. package/2D/style.js +97 -97
  117. package/2D/style.js.map +1 -1
  118. package/2D/valueAndUnit.d.ts +89 -89
  119. package/2D/valueAndUnit.js +226 -222
  120. package/2D/valueAndUnit.js.map +1 -1
  121. package/2D/xmlLoader.d.ts +60 -60
  122. package/2D/xmlLoader.js +348 -348
  123. package/2D/xmlLoader.js.map +1 -1
  124. package/3D/behaviors/defaultBehavior.d.ts +73 -73
  125. package/3D/behaviors/defaultBehavior.js +121 -121
  126. package/3D/behaviors/defaultBehavior.js.map +1 -1
  127. package/3D/controls/abstractButton3D.d.ts +15 -15
  128. package/3D/controls/abstractButton3D.js +25 -25
  129. package/3D/controls/abstractButton3D.js.map +1 -1
  130. package/3D/controls/button3D.d.ts +30 -30
  131. package/3D/controls/button3D.js +93 -93
  132. package/3D/controls/button3D.js.map +1 -1
  133. package/3D/controls/container3D.d.ts +72 -72
  134. package/3D/controls/container3D.js +139 -140
  135. package/3D/controls/container3D.js.map +1 -1
  136. package/3D/controls/contentDisplay3D.d.ts +30 -30
  137. package/3D/controls/contentDisplay3D.js +79 -78
  138. package/3D/controls/contentDisplay3D.js.map +1 -1
  139. package/3D/controls/control3D.d.ts +201 -165
  140. package/3D/controls/control3D.js +445 -408
  141. package/3D/controls/control3D.js.map +1 -1
  142. package/3D/controls/cylinderPanel.d.ts +17 -17
  143. package/3D/controls/cylinderPanel.js +66 -66
  144. package/3D/controls/cylinderPanel.js.map +1 -1
  145. package/3D/controls/handMenu.d.ts +28 -28
  146. package/3D/controls/handMenu.js +47 -47
  147. package/3D/controls/handMenu.js.map +1 -1
  148. package/3D/controls/holographicBackplate.d.ts +49 -48
  149. package/3D/controls/holographicBackplate.js +120 -120
  150. package/3D/controls/holographicBackplate.js.map +1 -1
  151. package/3D/controls/holographicButton.d.ts +84 -83
  152. package/3D/controls/holographicButton.js +339 -338
  153. package/3D/controls/holographicButton.js.map +1 -1
  154. package/3D/controls/holographicSlate.d.ts +131 -128
  155. package/3D/controls/holographicSlate.js +431 -428
  156. package/3D/controls/holographicSlate.js.map +1 -1
  157. package/3D/controls/index.d.ts +21 -21
  158. package/3D/controls/index.js +21 -21
  159. package/3D/controls/index.js.map +1 -1
  160. package/3D/controls/meshButton3D.d.ts +21 -21
  161. package/3D/controls/meshButton3D.js +62 -61
  162. package/3D/controls/meshButton3D.js.map +1 -1
  163. package/3D/controls/nearMenu.d.ts +44 -44
  164. package/3D/controls/nearMenu.js +114 -112
  165. package/3D/controls/nearMenu.js.map +1 -1
  166. package/3D/controls/planePanel.d.ts +9 -9
  167. package/3D/controls/planePanel.js +36 -36
  168. package/3D/controls/planePanel.js.map +1 -1
  169. package/3D/controls/scatterPanel.d.ts +18 -18
  170. package/3D/controls/scatterPanel.js +108 -108
  171. package/3D/controls/scatterPanel.js.map +1 -1
  172. package/3D/controls/slider3D.d.ts +81 -80
  173. package/3D/controls/slider3D.js +268 -267
  174. package/3D/controls/slider3D.js.map +1 -1
  175. package/3D/controls/spherePanel.d.ts +17 -17
  176. package/3D/controls/spherePanel.js +67 -67
  177. package/3D/controls/spherePanel.js.map +1 -1
  178. package/3D/controls/stackPanel3D.d.ts +22 -22
  179. package/3D/controls/stackPanel3D.js +107 -107
  180. package/3D/controls/stackPanel3D.js.map +1 -1
  181. package/3D/controls/touchButton3D.d.ts +80 -75
  182. package/3D/controls/touchButton3D.js +233 -227
  183. package/3D/controls/touchButton3D.js.map +1 -1
  184. package/3D/controls/touchHolographicButton.d.ts +110 -109
  185. package/3D/controls/touchHolographicButton.js +445 -445
  186. package/3D/controls/touchHolographicButton.js.map +1 -1
  187. package/3D/controls/touchHolographicMenu.d.ts +61 -61
  188. package/3D/controls/touchHolographicMenu.js +149 -148
  189. package/3D/controls/touchHolographicMenu.js.map +1 -1
  190. package/3D/controls/touchMeshButton3D.d.ts +21 -22
  191. package/3D/controls/touchMeshButton3D.js +62 -62
  192. package/3D/controls/touchMeshButton3D.js.map +1 -1
  193. package/3D/controls/volumeBasedPanel.d.ts +53 -52
  194. package/3D/controls/volumeBasedPanel.js +174 -174
  195. package/3D/controls/volumeBasedPanel.js.map +1 -1
  196. package/3D/gizmos/gizmoHandle.d.ts +108 -108
  197. package/3D/gizmos/gizmoHandle.js +209 -209
  198. package/3D/gizmos/gizmoHandle.js.map +1 -1
  199. package/3D/gizmos/index.d.ts +2 -2
  200. package/3D/gizmos/index.js +2 -2
  201. package/3D/gizmos/index.js.map +1 -1
  202. package/3D/gizmos/slateGizmo.d.ts +57 -57
  203. package/3D/gizmos/slateGizmo.js +369 -369
  204. package/3D/gizmos/slateGizmo.js.map +1 -1
  205. package/3D/gui3DManager.d.ts +94 -94
  206. package/3D/gui3DManager.js +257 -257
  207. package/3D/gui3DManager.js.map +1 -1
  208. package/3D/index.d.ts +5 -5
  209. package/3D/index.js +6 -5
  210. package/3D/index.js.map +1 -1
  211. package/3D/materials/fluent/fluentMaterial.d.ts +91 -90
  212. package/3D/materials/fluent/fluentMaterial.js +292 -281
  213. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  214. package/3D/materials/fluent/index.d.ts +1 -1
  215. package/3D/materials/fluent/index.js +1 -1
  216. package/3D/materials/fluent/index.js.map +1 -1
  217. package/3D/materials/fluent/shaders/fluent.fragment.d.ts +5 -5
  218. package/3D/materials/fluent/shaders/fluent.fragment.js +8 -6
  219. package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
  220. package/3D/materials/fluent/shaders/fluent.vertex.d.ts +5 -5
  221. package/3D/materials/fluent/shaders/fluent.vertex.js +8 -6
  222. package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
  223. package/3D/materials/fluentBackplate/fluentBackplateMaterial.d.ts +155 -154
  224. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +469 -434
  225. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  226. package/3D/materials/fluentBackplate/index.d.ts +1 -1
  227. package/3D/materials/fluentBackplate/index.js +1 -1
  228. package/3D/materials/fluentBackplate/index.js.map +1 -1
  229. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.d.ts +5 -5
  230. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +8 -6
  231. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
  232. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.d.ts +5 -5
  233. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +8 -6
  234. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
  235. package/3D/materials/fluentButton/fluentButtonMaterial.d.ts +190 -189
  236. package/3D/materials/fluentButton/fluentButtonMaterial.js +539 -537
  237. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  238. package/3D/materials/fluentButton/index.d.ts +1 -1
  239. package/3D/materials/fluentButton/index.js +1 -1
  240. package/3D/materials/fluentButton/index.js.map +1 -1
  241. package/3D/materials/fluentButton/shaders/fluentButton.fragment.d.ts +5 -5
  242. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +8 -6
  243. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
  244. package/3D/materials/fluentButton/shaders/fluentButton.vertex.d.ts +5 -5
  245. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +8 -6
  246. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
  247. package/3D/materials/fluentMaterial.d.ts +4 -4
  248. package/3D/materials/fluentMaterial.js +4 -4
  249. package/3D/materials/fluentMaterial.js.map +1 -1
  250. package/3D/materials/handle/handleMaterial.d.ts +68 -68
  251. package/3D/materials/handle/handleMaterial.js +126 -126
  252. package/3D/materials/handle/handleMaterial.js.map +1 -1
  253. package/3D/materials/handle/index.d.ts +1 -1
  254. package/3D/materials/handle/index.js +1 -1
  255. package/3D/materials/handle/index.js.map +1 -1
  256. package/3D/materials/handle/shaders/handle.fragment.d.ts +5 -5
  257. package/3D/materials/handle/shaders/handle.fragment.js +8 -6
  258. package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
  259. package/3D/materials/handle/shaders/handle.vertex.d.ts +5 -5
  260. package/3D/materials/handle/shaders/handle.vertex.js +8 -6
  261. package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
  262. package/3D/materials/index.d.ts +5 -5
  263. package/3D/materials/index.js +6 -5
  264. package/3D/materials/index.js.map +1 -1
  265. package/3D/materials/mrdl/index.d.ts +3 -3
  266. package/3D/materials/mrdl/index.js +3 -3
  267. package/3D/materials/mrdl/index.js.map +1 -1
  268. package/3D/materials/mrdl/mrdlBackplateMaterial.d.ts +148 -147
  269. package/3D/materials/mrdl/mrdlBackplateMaterial.js +436 -409
  270. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  271. package/3D/materials/mrdl/mrdlSliderBarMaterial.d.ts +334 -333
  272. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +851 -786
  273. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  274. package/3D/materials/mrdl/mrdlSliderThumbMaterial.d.ts +334 -333
  275. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +851 -786
  276. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  277. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.d.ts +5 -5
  278. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +8 -6
  279. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
  280. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.d.ts +5 -5
  281. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +8 -6
  282. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
  283. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.d.ts +5 -5
  284. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +8 -6
  285. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
  286. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.d.ts +5 -5
  287. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +8 -6
  288. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
  289. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.d.ts +5 -5
  290. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +8 -6
  291. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
  292. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.d.ts +5 -5
  293. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +8 -6
  294. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
  295. package/3D/vector3WithInfo.d.ts +16 -16
  296. package/3D/vector3WithInfo.js +23 -23
  297. package/3D/vector3WithInfo.js.map +1 -1
  298. package/index.d.ts +2 -2
  299. package/index.js +3 -2
  300. package/index.js.map +1 -1
  301. package/legacy/legacy.d.ts +1 -1
  302. package/legacy/legacy.js +14 -13
  303. package/legacy/legacy.js.map +1 -1
  304. package/package.json +21 -328
  305. package/readme.md +2 -2
@@ -1,423 +1,449 @@
1
- import { Nullable } from "@babylonjs/core/types";
2
- import { Observable } from "@babylonjs/core/Misc/observable";
3
- import { Vector2, Vector3, Matrix } from "@babylonjs/core/Maths/math.vector";
4
- import { ClipboardInfo } from "@babylonjs/core/Events/clipboardEvents";
5
- import { DynamicTexture } from "@babylonjs/core/Materials/Textures/dynamicTexture";
6
- import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh";
7
- import { Layer } from "@babylonjs/core/Layers/layer";
8
- import { Scene } from "@babylonjs/core/scene";
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";
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
- /** @hidden */
302
- _changeCursor(cursor: string): void;
303
- /** @hidden */
304
- _registerLastControlDown(control: Control, pointerId: number): void;
305
- private _doPicking;
306
- /** @hidden */
307
- _cleanControlAfterRemovalFromList(list: {
308
- [pointerId: number]: Control;
309
- }, control: Control): void;
310
- /** @hidden */
311
- _cleanControlAfterRemoval(control: Control): void;
312
- private _translateToPicking;
313
- /** Attach to all scene events required to support pointer events */
314
- attach(): void;
315
- /** @hidden */
316
- private onClipboardCopy;
317
- /** @hidden */
318
- private onClipboardCut;
319
- /** @hidden */
320
- private onClipboardPaste;
321
- /**
322
- * Register the clipboard Events onto the canvas
323
- */
324
- registerClipboardEvents(): void;
325
- /**
326
- * Unregister the clipboard Events from the canvas
327
- */
328
- unRegisterClipboardEvents(): void;
329
- /**
330
- * Connect the texture to a hosting mesh to enable interactions
331
- * @param mesh defines the mesh to attach to
332
- * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
333
- */
334
- attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
335
- /**
336
- * Move the focus to a specific control
337
- * @param control defines the control which will receive the focus
338
- */
339
- moveFocusToControl(control: IFocusableControl): void;
340
- private _manageFocus;
341
- private _attachPickingToSceneRender;
342
- private _attachToOnPointerOut;
343
- private _attachToOnBlur;
344
- /**
345
- * Serializes the entire GUI system
346
- * @returns an object with the JSON serialized data
347
- */
348
- serializeContent(): any;
349
- /**
350
- * Recreate the content of the ADT from a JSON object
351
- * @param serializedObject define the JSON serialized object to restore from
352
- * @param scaleToSize defines whether to scale to texture to the saved size
353
- */
354
- parseContent(serializedObject: any, scaleToSize?: boolean): void;
355
- /**
356
- * Recreate the content of the ADT from a snippet saved by the GUI editor
357
- * @param snippetId defines the snippet to load
358
- * @param scaleToSize defines whether to scale to texture to the saved size
359
- * @returns a promise that will resolve on success
360
- */
361
- parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean): Promise<void>;
362
- /**
363
- * Recreate the content of the ADT from a url json
364
- * @param url defines the url to load
365
- * @param scaleToSize defines whether to scale to texture to the saved size
366
- * @returns a promise that will resolve on success
367
- */
368
- parseFromURLAsync(url: string, scaleToSize?: boolean): Promise<void>;
369
- /**
370
- * Compares two rectangle based controls for pixel overlap
371
- * @param control1 The first control to compare
372
- * @param control2 The second control to compare
373
- * @returns true if overlaps, otherwise false
374
- */
375
- private static _Overlaps;
376
- /**
377
- * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
378
- * @param mesh defines the mesh which will receive the texture
379
- * @param width defines the texture width (1024 by default)
380
- * @param height defines the texture height (1024 by default)
381
- * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
382
- * @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)
383
- * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
384
- * @returns a new AdvancedDynamicTexture
385
- */
386
- static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean, invertY?: boolean): AdvancedDynamicTexture;
387
- /**
388
- * 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
389
- * @param mesh defines the mesh which will receive the texture
390
- * @param width defines the texture width (1024 by default)
391
- * @param height defines the texture height (1024 by default)
392
- * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
393
- * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
394
- * @returns a new AdvancedDynamicTexture
395
- */
396
- static CreateForMeshTexture(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, invertY?: boolean): AdvancedDynamicTexture;
397
- /**
398
- * Creates a new AdvancedDynamicTexture in fullscreen mode.
399
- * In this mode the texture will rely on a layer for its rendering.
400
- * This allows it to be treated like any other layer.
401
- * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
402
- * LayerMask is set through advancedTexture.layer.layerMask
403
- * @param name defines name for the texture
404
- * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
405
- * @param scene defines the hosting scene
406
- * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
407
- * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)
408
- * @returns a new AdvancedDynamicTexture
409
- */
410
- static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number, adaptiveScaling?: boolean): AdvancedDynamicTexture;
411
- /**
412
- * Scales the texture
413
- * @param ratio the scale factor to apply to both width and height
414
- */
415
- scale(ratio: number): void;
416
- /**
417
- * Resizes the texture
418
- * @param width the new width
419
- * @param height the new height
420
- */
421
- scaleTo(width: number, height: number): void;
422
- }
423
- 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 };