@babylonjs/gui 5.0.0-alpha.60 → 5.0.0-alpha.64

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 (44) hide show
  1. package/2D/advancedDynamicTexture.d.ts +153 -135
  2. package/2D/advancedDynamicTexture.js +258 -157
  3. package/2D/advancedDynamicTexture.js.map +1 -1
  4. package/2D/controls/container.js +2 -2
  5. package/2D/controls/container.js.map +1 -1
  6. package/2D/controls/control.d.ts +66 -32
  7. package/2D/controls/control.js +180 -76
  8. package/2D/controls/control.js.map +1 -1
  9. package/2D/controls/grid.d.ts +5 -3
  10. package/2D/controls/grid.js +48 -21
  11. package/2D/controls/grid.js.map +1 -1
  12. package/2D/controls/inputText.js +1 -1
  13. package/2D/controls/inputText.js.map +1 -1
  14. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  15. package/2D/controls/stackPanel.d.ts +7 -1
  16. package/2D/controls/stackPanel.js +29 -7
  17. package/2D/controls/stackPanel.js.map +1 -1
  18. package/2D/controls/textBlock.js +5 -5
  19. package/2D/controls/textBlock.js.map +1 -1
  20. package/2D/math2D.d.ts +5 -0
  21. package/2D/math2D.js +12 -0
  22. package/2D/math2D.js.map +1 -1
  23. package/2D/valueAndUnit.d.ts +21 -6
  24. package/2D/valueAndUnit.js +57 -13
  25. package/2D/valueAndUnit.js.map +1 -1
  26. package/3D/controls/button3D.js +8 -1
  27. package/3D/controls/button3D.js.map +1 -1
  28. package/3D/controls/control3D.d.ts +2 -0
  29. package/3D/controls/control3D.js +3 -0
  30. package/3D/controls/control3D.js.map +1 -1
  31. package/3D/controls/holographicButton.js +9 -8
  32. package/3D/controls/holographicButton.js.map +1 -1
  33. package/3D/controls/holographicSlate.js +11 -6
  34. package/3D/controls/holographicSlate.js.map +1 -1
  35. package/3D/controls/nearMenu.js +1 -1
  36. package/3D/controls/nearMenu.js.map +1 -1
  37. package/3D/controls/touchHolographicButton.js +12 -12
  38. package/3D/controls/touchHolographicButton.js.map +1 -1
  39. package/3D/controls/touchHolographicMenu.js +13 -11
  40. package/3D/controls/touchHolographicMenu.js.map +1 -1
  41. package/3D/gui3DManager.d.ts +10 -0
  42. package/3D/gui3DManager.js +43 -0
  43. package/3D/gui3DManager.js.map +1 -1
  44. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  import { Nullable } from "@babylonjs/core/types";
2
2
  import { Observable } from "@babylonjs/core/Misc/observable";
3
3
  import { Vector2, Vector3 } from "@babylonjs/core/Maths/math.vector";
4
- import { PointerInfoBase } from '@babylonjs/core/Events/pointerEvents';
4
+ import { PointerInfoBase } from "@babylonjs/core/Events/pointerEvents";
5
5
  import { TransformNode } from "@babylonjs/core/Meshes/transformNode";
6
6
  import { Scene } from "@babylonjs/core/scene";
7
7
  import { Container } from "./container";
@@ -10,7 +10,7 @@ import { ValueAndUnit } from "../valueAndUnit";
10
10
  import { Measure } from "../measure";
11
11
  import { Style } from "../style";
12
12
  import { Matrix2D, Vector2WithInfo } from "../math2D";
13
- import { ICanvasRenderingContext } from '@babylonjs/core/Engines/ICanvas';
13
+ import { ICanvasRenderingContext } from "@babylonjs/core/Engines/ICanvas";
14
14
  /**
15
15
  * Root class used for all 2D controls
16
16
  * @see https://doc.babylonjs.com/how_to/gui#controls
@@ -31,6 +31,8 @@ export declare class Control {
31
31
  parent: Nullable<Container>;
32
32
  /** @hidden */
33
33
  _currentMeasure: Measure;
34
+ /** @hidden */
35
+ _tempPaddingMeasure: Measure;
34
36
  private _fontFamily;
35
37
  private _fontStyle;
36
38
  private _fontWeight;
@@ -63,6 +65,7 @@ export declare class Control {
63
65
  _prevCurrentMeasureTransformedIntoGlobalSpace: Measure;
64
66
  /** @hidden */
65
67
  protected _cachedParentMeasure: Measure;
68
+ private _descendantsOnlyPadding;
66
69
  private _paddingLeft;
67
70
  private _paddingRight;
68
71
  private _paddingTop;
@@ -97,6 +100,8 @@ export declare class Control {
97
100
  private _enterCount;
98
101
  private _doNotRender;
99
102
  private _downPointerIds;
103
+ private _evaluatedMeasure;
104
+ private _evaluatedParentMeasure;
100
105
  protected _isEnabled: boolean;
101
106
  protected _disabledColor: string;
102
107
  protected _disabledColorItem: string;
@@ -121,6 +126,10 @@ export declare class Control {
121
126
  */
122
127
  get isReadOnly(): boolean;
123
128
  set isReadOnly(value: boolean);
129
+ /**
130
+ * Gets the transformed measure, that is the bounding box of the control after applying all transformations
131
+ */
132
+ get transformedMeasure(): Measure;
124
133
  /**
125
134
  * Gets or sets an object used to store user defined information for the node
126
135
  */
@@ -177,36 +186,36 @@ export declare class Control {
177
186
  */
178
187
  getClassName(): string;
179
188
  /**
180
- * An event triggered when pointer wheel is scrolled
181
- */
189
+ * An event triggered when pointer wheel is scrolled
190
+ */
182
191
  onWheelObservable: Observable<Vector2>;
183
192
  /**
184
- * An event triggered when the pointer moves over the control.
185
- */
193
+ * An event triggered when the pointer moves over the control.
194
+ */
186
195
  onPointerMoveObservable: Observable<Vector2>;
187
196
  /**
188
- * An event triggered when the pointer moves out of the control.
189
- */
197
+ * An event triggered when the pointer moves out of the control.
198
+ */
190
199
  onPointerOutObservable: Observable<Control>;
191
200
  /**
192
- * An event triggered when the pointer taps the control
193
- */
201
+ * An event triggered when the pointer taps the control
202
+ */
194
203
  onPointerDownObservable: Observable<Vector2WithInfo>;
195
204
  /**
196
- * An event triggered when pointer up
197
- */
205
+ * An event triggered when pointer up
206
+ */
198
207
  onPointerUpObservable: Observable<Vector2WithInfo>;
199
208
  /**
200
- * An event triggered when a control is clicked on
201
- */
209
+ * An event triggered when a control is clicked on
210
+ */
202
211
  onPointerClickObservable: Observable<Vector2WithInfo>;
203
212
  /**
204
- * An event triggered when pointer enters the control
205
- */
213
+ * An event triggered when pointer enters the control
214
+ */
206
215
  onPointerEnterObservable: Observable<Control>;
207
216
  /**
208
- * An event triggered when the control is marked as dirty
209
- */
217
+ * An event triggered when the control is marked as dirty
218
+ */
210
219
  onDirtyObservable: Observable<Control>;
211
220
  /**
212
221
  * An event triggered before drawing the control
@@ -217,8 +226,8 @@ export declare class Control {
217
226
  */
218
227
  onAfterDrawObservable: Observable<Control>;
219
228
  /**
220
- * An event triggered when the control has been disposed
221
- */
229
+ * An event triggered when the control has been disposed
230
+ */
222
231
  onDisposeObservable: Observable<Control>;
223
232
  /**
224
233
  * Get the hosting AdvancedDynamicTexture
@@ -255,27 +264,27 @@ export declare class Control {
255
264
  set highlightColor(value: string);
256
265
  /** Gets or sets a value indicating the scale factor on X axis (1 by default)
257
266
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
258
- */
267
+ */
259
268
  get scaleX(): number;
260
269
  set scaleX(value: number);
261
270
  /** Gets or sets a value indicating the scale factor on Y axis (1 by default)
262
271
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
263
- */
272
+ */
264
273
  get scaleY(): number;
265
274
  set scaleY(value: number);
266
275
  /** Gets or sets the rotation angle (0 by default)
267
276
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
268
- */
277
+ */
269
278
  get rotation(): number;
270
279
  set rotation(value: number);
271
280
  /** Gets or sets the transformation center on Y axis (0 by default)
272
281
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
273
- */
282
+ */
274
283
  get transformCenterY(): number;
275
284
  set transformCenterY(value: number);
276
285
  /** Gets or sets the transformation center on X axis (0 by default)
277
286
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
278
- */
287
+ */
279
288
  get transformCenterX(): number;
280
289
  set transformCenterX(value: number);
281
290
  /**
@@ -363,6 +372,12 @@ export declare class Control {
363
372
  * Gets the current linked mesh (or null if none)
364
373
  */
365
374
  get linkedMesh(): Nullable<TransformNode>;
375
+ /**
376
+ * Gets or sets a value indicating the padding should work like in CSS.
377
+ * Basically, it will add the padding amount on each side of the parent control for its children.
378
+ */
379
+ get descendantsOnlyPadding(): boolean;
380
+ set descendantsOnlyPadding(value: boolean);
366
381
  /**
367
382
  * Gets or sets a value indicating the padding to use on the left of the control
368
383
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -375,6 +390,8 @@ export declare class Control {
375
390
  */
376
391
  get paddingLeftInPixels(): number;
377
392
  set paddingLeftInPixels(value: number);
393
+ /** @hidden */
394
+ get _paddingLeftInPixels(): number;
378
395
  /**
379
396
  * Gets or sets a value indicating the padding to use on the right of the control
380
397
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -387,6 +404,8 @@ export declare class Control {
387
404
  */
388
405
  get paddingRightInPixels(): number;
389
406
  set paddingRightInPixels(value: number);
407
+ /** @hidden */
408
+ get _paddingRightInPixels(): number;
390
409
  /**
391
410
  * Gets or sets a value indicating the padding to use on the top of the control
392
411
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -399,6 +418,8 @@ export declare class Control {
399
418
  */
400
419
  get paddingTopInPixels(): number;
401
420
  set paddingTopInPixels(value: number);
421
+ /** @hidden */
422
+ get _paddingTopInPixels(): number;
402
423
  /**
403
424
  * Gets or sets a value indicating the padding to use on the bottom of the control
404
425
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -411,6 +432,8 @@ export declare class Control {
411
432
  */
412
433
  get paddingBottomInPixels(): number;
413
434
  set paddingBottomInPixels(value: number);
435
+ /** @hidden */
436
+ get _paddingBottomInPixels(): number;
414
437
  /**
415
438
  * Gets or sets a value indicating the left coordinate of the control
416
439
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -472,6 +495,17 @@ export declare class Control {
472
495
  /** Gets or sets front color of control if it's disabled */
473
496
  get disabledColorItem(): string;
474
497
  set disabledColorItem(value: string);
498
+ /**
499
+ * Gets/sets the overlap group of the control.
500
+ * Controls with overlapGroup set to a number can be deoverlapped.
501
+ * Controls with overlapGroup set to undefined are not deoverlapped.
502
+ * @see https://doc.babylonjs.com/how_to/gui#deoverlapping
503
+ */
504
+ overlapGroup?: number;
505
+ /**
506
+ * Gets/sets the deoverlap movement multiplier
507
+ */
508
+ overlapDeltaMultiplier?: number;
475
509
  /**
476
510
  * Creates a new control
477
511
  * @param name defines the name of the control
@@ -541,13 +575,13 @@ export declare class Control {
541
575
  */
542
576
  linkWithMesh(mesh: Nullable<TransformNode>): void;
543
577
  /**
544
- * Shorthand funtion to set the top, right, bottom, and left padding values on the control.
545
- * @param { string | number} paddingTop - The value of the top padding.
546
- * @param { string | number} paddingRight - The value of the right padding. If omitted, top is used.
547
- * @param { string | number} paddingBottom - The value of the bottom padding. If omitted, top is used.
548
- * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.
549
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
550
- */
578
+ * Shorthand funtion to set the top, right, bottom, and left padding values on the control.
579
+ * @param { string | number} paddingTop - The value of the top padding.
580
+ * @param { string | number} paddingRight - The value of the right padding. If omitted, top is used.
581
+ * @param { string | number} paddingBottom - The value of the bottom padding. If omitted, top is used.
582
+ * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.
583
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
584
+ */
551
585
  setPadding(paddingTop: string | number, paddingRight?: string | number, paddingBottom?: string | number, paddingLeft?: string | number): void;
552
586
  /**
553
587
  * Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.