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.
@@ -35,26 +35,30 @@ declare module "babylonjs-gui/2D/controls/focusableControl" {
35
35
  }
36
36
  }
37
37
  declare module "babylonjs-gui/2D/valueAndUnit" {
38
+ import { Observable } from "babylonjs/Misc/observable";
38
39
  import { AdvancedDynamicTexture } from "babylonjs-gui/2D/advancedDynamicTexture";
39
40
  /**
40
41
  * Class used to specific a value and its associated unit
41
42
  */
42
43
  export class ValueAndUnit {
43
- /** defines the unit to store */
44
- unit: number;
45
44
  /** defines a boolean indicating if the value can be negative */
46
45
  negativeValueAllowed: boolean;
47
46
  private _value;
47
+ private _unit;
48
48
  private _originalUnit;
49
49
  /**
50
50
  * Gets or sets a value indicating that this value will not scale accordingly with adaptive scaling property
51
51
  * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
52
52
  */
53
53
  ignoreAdaptiveScaling: boolean;
54
+ /**
55
+ * Observable event triggered each time the value or unit changes
56
+ */
57
+ onChangedObservable: Observable<void>;
54
58
  /**
55
59
  * Creates a new ValueAndUnit
56
60
  * @param value defines the value to store
57
- * @param unit defines the unit to store
61
+ * @param unit defines the unit to store - defaults to ValueAndUnit.UNITMODE_PIXEL
58
62
  * @param negativeValueAllowed defines a boolean indicating if the value can be negative
59
63
  */
60
64
  constructor(value: number,
@@ -66,8 +70,19 @@ declare module "babylonjs-gui/2D/valueAndUnit" {
66
70
  get isPercentage(): boolean;
67
71
  /** Gets a boolean indicating if the value is store as pixel */
68
72
  get isPixel(): boolean;
69
- /** Gets direct internal value */
73
+ /**
74
+ * Gets value (without units)
75
+ * @deprecated use value property instead
76
+ */
70
77
  get internalValue(): number;
78
+ /** Gets value (without units) */
79
+ get value(): number;
80
+ /** Sets value (without units) */
81
+ set value(value: number);
82
+ /** Gets units (without value) */
83
+ get unit(): number;
84
+ /** Sets units (without value) */
85
+ set unit(value: number);
71
86
  /**
72
87
  * Gets value as pixel
73
88
  * @param host defines the root host
@@ -76,7 +91,7 @@ declare module "babylonjs-gui/2D/valueAndUnit" {
76
91
  */
77
92
  getValueInPixel(host: AdvancedDynamicTexture, refValue: number): number;
78
93
  /**
79
- * Update the current value and unit. This should be done cautiously as the GUi won't be marked as dirty with this function.
94
+ * Update the current value and unit.
80
95
  * @param value defines the value to store
81
96
  * @param unit defines the unit to store
82
97
  * @returns the current ValueAndUnit
@@ -98,7 +113,7 @@ declare module "babylonjs-gui/2D/valueAndUnit" {
98
113
  /**
99
114
  * Store a value parsed from a string
100
115
  * @param source defines the source string
101
- * @returns true if the value was successfully parsed
116
+ * @returns true if the value was successfully parsed and updated
102
117
  */
103
118
  fromString(source: string | number): boolean;
104
119
  private static _Regex;
@@ -232,6 +247,11 @@ declare module "babylonjs-gui/2D/math2D" {
232
247
  * @returns a new matrix
233
248
  */
234
249
  static Identity(): Matrix2D;
250
+ /**
251
+ * Creates an identity matrix and stores it in a target matrix
252
+ * @param result defines the target matrix
253
+ */
254
+ static IdentityToRef(result: Matrix2D): void;
235
255
  /**
236
256
  * Creates a translation matrix and stores it in a target matrix
237
257
  * @param x defines the x coordinate of the translation
@@ -364,14 +384,16 @@ declare module "babylonjs-gui/2D/advancedDynamicTexture" {
364
384
  import { Control } from "babylonjs-gui/2D/controls/control";
365
385
  import { IFocusableControl } from "babylonjs-gui/2D/controls/focusableControl";
366
386
  import { Style } from "babylonjs-gui/2D/style";
367
- import { Viewport } from 'babylonjs/Maths/math.viewport';
387
+ import { Viewport } from "babylonjs/Maths/math.viewport";
368
388
  /**
369
- * Class used to create texture to support 2D GUI elements
370
- * @see https://doc.babylonjs.com/how_to/gui
371
- */
389
+ * Class used to create texture to support 2D GUI elements
390
+ * @see https://doc.babylonjs.com/how_to/gui
391
+ */
372
392
  export class AdvancedDynamicTexture extends DynamicTexture {
373
393
  /** Define the Uurl to load snippets */
374
394
  static SnippetUrl: string;
395
+ /** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */
396
+ static AllowGPUOptimizations: boolean;
375
397
  /** Snippet ID if the content was created from the snippet server */
376
398
  snippetId: string;
377
399
  private _isDirty;
@@ -426,152 +448,152 @@ declare module "babylonjs-gui/2D/advancedDynamicTexture" {
426
448
  /** Gets the number of render calls made the last time the ADT has been rendered */
427
449
  get numRenderCalls(): number;
428
450
  /**
429
- * Define type to string to ensure compatibility across browsers
430
- * Safari doesn't support DataTransfer constructor
431
- */
451
+ * Define type to string to ensure compatibility across browsers
452
+ * Safari doesn't support DataTransfer constructor
453
+ */
432
454
  private _clipboardData;
433
455
  /**
434
- * Observable event triggered each time an clipboard event is received from the rendering canvas
435
- */
456
+ * Observable event triggered each time an clipboard event is received from the rendering canvas
457
+ */
436
458
  onClipboardObservable: Observable<ClipboardInfo>;
437
459
  /**
438
- * Observable event triggered each time a pointer down is intercepted by a control
439
- */
460
+ * Observable event triggered each time a pointer down is intercepted by a control
461
+ */
440
462
  onControlPickedObservable: Observable<Control>;
441
463
  /**
442
- * Observable event triggered before layout is evaluated
443
- */
464
+ * Observable event triggered before layout is evaluated
465
+ */
444
466
  onBeginLayoutObservable: Observable<AdvancedDynamicTexture>;
445
467
  /**
446
- * Observable event triggered after the layout was evaluated
447
- */
468
+ * Observable event triggered after the layout was evaluated
469
+ */
448
470
  onEndLayoutObservable: Observable<AdvancedDynamicTexture>;
449
471
  /**
450
- * Observable event triggered before the texture is rendered
451
- */
472
+ * Observable event triggered before the texture is rendered
473
+ */
452
474
  onBeginRenderObservable: Observable<AdvancedDynamicTexture>;
453
475
  /**
454
- * Observable event triggered after the texture was rendered
455
- */
476
+ * Observable event triggered after the texture was rendered
477
+ */
456
478
  onEndRenderObservable: Observable<AdvancedDynamicTexture>;
457
479
  /**
458
- * Gets or sets a boolean defining if alpha is stored as premultiplied
459
- */
480
+ * Gets or sets a boolean defining if alpha is stored as premultiplied
481
+ */
460
482
  premulAlpha: boolean;
461
483
  /**
462
484
  * Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture
463
485
  */
464
486
  applyYInversionOnUpdate: boolean;
465
487
  /**
466
- * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
467
- * Useful when you want more antialiasing
468
- */
488
+ * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
489
+ * Useful when you want more antialiasing
490
+ */
469
491
  get renderScale(): number;
470
492
  set renderScale(value: number);
471
493
  /** Gets or sets the background color */
472
494
  get background(): string;
473
495
  set background(value: string);
474
496
  /**
475
- * Gets or sets the ideal width used to design controls.
476
- * The GUI will then rescale everything accordingly
477
- * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
478
- */
497
+ * Gets or sets the ideal width used to design controls.
498
+ * The GUI will then rescale everything accordingly
499
+ * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
500
+ */
479
501
  get idealWidth(): number;
480
502
  set idealWidth(value: number);
481
503
  /**
482
- * Gets or sets the ideal height used to design controls.
483
- * The GUI will then rescale everything accordingly
484
- * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
485
- */
504
+ * Gets or sets the ideal height used to design controls.
505
+ * The GUI will then rescale everything accordingly
506
+ * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
507
+ */
486
508
  get idealHeight(): number;
487
509
  set idealHeight(value: number);
488
510
  /**
489
- * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
490
- * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
491
- */
511
+ * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
512
+ * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
513
+ */
492
514
  get useSmallestIdeal(): boolean;
493
515
  set useSmallestIdeal(value: boolean);
494
516
  /**
495
- * Gets or sets a boolean indicating if adaptive scaling must be used
496
- * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
497
- */
517
+ * Gets or sets a boolean indicating if adaptive scaling must be used
518
+ * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
519
+ */
498
520
  get renderAtIdealSize(): boolean;
499
521
  set renderAtIdealSize(value: boolean);
500
522
  /**
501
523
  * Gets the ratio used when in "ideal mode"
502
- * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
524
+ * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
503
525
  * */
504
526
  get idealRatio(): number;
505
527
  /**
506
- * Gets the underlying layer used to render the texture when in fullscreen mode
507
- */
528
+ * Gets the underlying layer used to render the texture when in fullscreen mode
529
+ */
508
530
  get layer(): Nullable<Layer>;
509
531
  /**
510
- * Gets the root container control
511
- */
532
+ * Gets the root container control
533
+ */
512
534
  get rootContainer(): Container;
513
535
  /**
514
- * Returns an array containing the root container.
515
- * This is mostly used to let the Inspector introspects the ADT
516
- * @returns an array containing the rootContainer
517
- */
536
+ * Returns an array containing the root container.
537
+ * This is mostly used to let the Inspector introspects the ADT
538
+ * @returns an array containing the rootContainer
539
+ */
518
540
  getChildren(): Array<Container>;
519
541
  /**
520
- * Will return all controls that are inside this texture
521
- * @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
522
- * @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
523
- * @return all child controls
524
- */
542
+ * Will return all controls that are inside this texture
543
+ * @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
544
+ * @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
545
+ * @return all child controls
546
+ */
525
547
  getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[];
526
548
  /**
527
- * Will return all controls with the given type name
528
- * @param typeName defines the type name to search for
529
- * @returns an array of all controls found
530
- */
549
+ * Will return all controls with the given type name
550
+ * @param typeName defines the type name to search for
551
+ * @returns an array of all controls found
552
+ */
531
553
  getControlsByType(typeName: string): Control[];
532
554
  /**
533
- * Will return the first control with the given name
534
- * @param name defines the name to search for
535
- * @return the first control found or null
536
- */
555
+ * Will return the first control with the given name
556
+ * @param name defines the name to search for
557
+ * @return the first control found or null
558
+ */
537
559
  getControlByName(name: string): Nullable<Control>;
538
560
  private _getControlByKey;
539
561
  /**
540
- * Gets or sets the current focused control
541
- */
562
+ * Gets or sets the current focused control
563
+ */
542
564
  get focusedControl(): Nullable<IFocusableControl>;
543
565
  set focusedControl(control: Nullable<IFocusableControl>);
544
566
  /**
545
- * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
546
- */
567
+ * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
568
+ */
547
569
  get isForeground(): boolean;
548
570
  set isForeground(value: boolean);
549
571
  /**
550
- * Gets or set information about clipboardData
551
- */
572
+ * Gets or set information about clipboardData
573
+ */
552
574
  get clipboardData(): string;
553
575
  set clipboardData(value: string);
554
576
  /**
555
- * Creates a new AdvancedDynamicTexture
556
- * @param name defines the name of the texture
557
- * @param width defines the width of the texture
558
- * @param height defines the height of the texture
559
- * @param scene defines the hosting scene
560
- * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
561
- * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
562
- * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
563
- */
577
+ * Creates a new AdvancedDynamicTexture
578
+ * @param name defines the name of the texture
579
+ * @param width defines the width of the texture
580
+ * @param height defines the height of the texture
581
+ * @param scene defines the hosting scene
582
+ * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
583
+ * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
584
+ * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
585
+ */
564
586
  constructor(name: string, width: number | undefined, height: number | undefined, scene: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number, invertY?: boolean);
565
587
  /**
566
- * Get the current class name of the texture useful for serialization or dynamic coding.
567
- * @returns "AdvancedDynamicTexture"
568
- */
588
+ * Get the current class name of the texture useful for serialization or dynamic coding.
589
+ * @returns "AdvancedDynamicTexture"
590
+ */
569
591
  getClassName(): string;
570
592
  /**
571
- * Function used to execute a function on all controls
572
- * @param func defines the function to execute
573
- * @param container defines the container where controls belong. If null the root container will be used
574
- */
593
+ * Function used to execute a function on all controls
594
+ * @param func defines the function to execute
595
+ * @param container defines the container where controls belong. If null the root container will be used
596
+ */
575
597
  executeOnAllControls(func: (control: Control) => void, container?: Container): void;
576
598
  private _useInvalidateRectOptimization;
577
599
  /**
@@ -589,47 +611,55 @@ declare module "babylonjs-gui/2D/advancedDynamicTexture" {
589
611
  */
590
612
  invalidateRect(invalidMinX: number, invalidMinY: number, invalidMaxX: number, invalidMaxY: number): void;
591
613
  /**
592
- * Marks the texture as dirty forcing a complete update
593
- */
614
+ * Marks the texture as dirty forcing a complete update
615
+ */
594
616
  markAsDirty(): void;
595
617
  /**
596
- * Helper function used to create a new style
597
- * @returns a new style
598
- * @see https://doc.babylonjs.com/how_to/gui#styles
599
- */
618
+ * Helper function used to create a new style
619
+ * @returns a new style
620
+ * @see https://doc.babylonjs.com/how_to/gui#styles
621
+ */
600
622
  createStyle(): Style;
601
623
  /**
602
- * Adds a new control to the root container
603
- * @param control defines the control to add
604
- * @returns the current texture
605
- */
624
+ * Adds a new control to the root container
625
+ * @param control defines the control to add
626
+ * @returns the current texture
627
+ */
606
628
  addControl(control: Control): AdvancedDynamicTexture;
607
629
  /**
608
- * Removes a control from the root container
609
- * @param control defines the control to remove
610
- * @returns the current texture
611
- */
630
+ * Removes a control from the root container
631
+ * @param control defines the control to remove
632
+ * @returns the current texture
633
+ */
612
634
  removeControl(control: Control): AdvancedDynamicTexture;
613
635
  /**
614
- * Release all resources
615
- */
636
+ * Moves overlapped controls towards a position where it is not overlapping anymore.
637
+ * Please note that this method alters linkOffsetXInPixels and linkOffsetYInPixels.
638
+ * @param overlapGroup the overlap group which will be processed or undefined to process all overlap groups
639
+ * @param deltaStep the step size (speed) to reach the target non overlapping position (default 0.1)
640
+ * @param repelFactor how much is the control repelled by other controls
641
+ */
642
+ moveToNonOverlappedPosition(overlapGroup?: number | Control[], deltaStep?: number, repelFactor?: number): void;
643
+ /**
644
+ * Release all resources
645
+ */
616
646
  dispose(): void;
617
647
  private _onResize;
618
648
  /** @hidden */
619
649
  _getGlobalViewport(): Viewport;
620
650
  /**
621
- * Get screen coordinates for a vector3
622
- * @param position defines the position to project
623
- * @param worldMatrix defines the world matrix to use
624
- * @returns the projected position
625
- */
651
+ * Get screen coordinates for a vector3
652
+ * @param position defines the position to project
653
+ * @param worldMatrix defines the world matrix to use
654
+ * @returns the projected position
655
+ */
626
656
  getProjectedPosition(position: Vector3, worldMatrix: Matrix): Vector2;
627
657
  /**
628
- * Get screen coordinates for a vector3
629
- * @param position defines the position to project
630
- * @param worldMatrix defines the world matrix to use
631
- * @returns the projected position with Z
632
- */
658
+ * Get screen coordinates for a vector3
659
+ * @param position defines the position to project
660
+ * @param worldMatrix defines the world matrix to use
661
+ * @returns the projected position with Z
662
+ */
633
663
  getProjectedPositionWithZ(position: Vector3, worldMatrix: Matrix): Vector3;
634
664
  private _checkUpdate;
635
665
  private _clearMeasure;
@@ -654,23 +684,23 @@ declare module "babylonjs-gui/2D/advancedDynamicTexture" {
654
684
  /** @hidden */
655
685
  private onClipboardPaste;
656
686
  /**
657
- * Register the clipboard Events onto the canvas
658
- */
687
+ * Register the clipboard Events onto the canvas
688
+ */
659
689
  registerClipboardEvents(): void;
660
690
  /**
661
691
  * Unregister the clipboard Events from the canvas
662
692
  */
663
693
  unRegisterClipboardEvents(): void;
664
694
  /**
665
- * Connect the texture to a hosting mesh to enable interactions
666
- * @param mesh defines the mesh to attach to
667
- * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
668
- */
695
+ * Connect the texture to a hosting mesh to enable interactions
696
+ * @param mesh defines the mesh to attach to
697
+ * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
698
+ */
669
699
  attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
670
700
  /**
671
- * Move the focus to a specific control
672
- * @param control defines the control which will receive the focus
673
- */
701
+ * Move the focus to a specific control
702
+ * @param control defines the control which will receive the focus
703
+ */
674
704
  moveFocusToControl(control: IFocusableControl): void;
675
705
  private _manageFocus;
676
706
  private _attachToOnPointerOut;
@@ -694,12 +724,19 @@ declare module "babylonjs-gui/2D/advancedDynamicTexture" {
694
724
  */
695
725
  parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean): Promise<void>;
696
726
  /**
697
- * Recreate the content of the ADT from a url json
698
- * @param url defines the url to load
699
- * @param scaleToSize defines whether to scale to texture to the saved size
700
- * @returns a promise that will resolve on success
701
- */
727
+ * Recreate the content of the ADT from a url json
728
+ * @param url defines the url to load
729
+ * @param scaleToSize defines whether to scale to texture to the saved size
730
+ * @returns a promise that will resolve on success
731
+ */
702
732
  parseFromURLAsync(url: string, scaleToSize?: boolean): Promise<void>;
733
+ /**
734
+ * Compares two rectangle based controls for pixel overlap
735
+ * @param control1 The first control to compare
736
+ * @param control2 The second control to compare
737
+ * @returns true if overlaps, otherwise false
738
+ */
739
+ private static _Overlaps;
703
740
  /**
704
741
  * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
705
742
  * @param mesh defines the mesh which will receive the texture
@@ -722,25 +759,26 @@ declare module "babylonjs-gui/2D/advancedDynamicTexture" {
722
759
  */
723
760
  static CreateForMeshTexture(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, invertY?: boolean): AdvancedDynamicTexture;
724
761
  /**
725
- * Creates a new AdvancedDynamicTexture in fullscreen mode.
726
- * In this mode the texture will rely on a layer for its rendering.
727
- * This allows it to be treated like any other layer.
728
- * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
729
- * LayerMask is set through advancedTexture.layer.layerMask
730
- * @param name defines name for the texture
731
- * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
732
- * @param scene defines the hosting scene
733
- * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
734
- * @returns a new AdvancedDynamicTexture
735
- */
736
- static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number): AdvancedDynamicTexture;
762
+ * Creates a new AdvancedDynamicTexture in fullscreen mode.
763
+ * In this mode the texture will rely on a layer for its rendering.
764
+ * This allows it to be treated like any other layer.
765
+ * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
766
+ * LayerMask is set through advancedTexture.layer.layerMask
767
+ * @param name defines name for the texture
768
+ * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
769
+ * @param scene defines the hosting scene
770
+ * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
771
+ * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)
772
+ * @returns a new AdvancedDynamicTexture
773
+ */
774
+ static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number, adaptiveScaling?: boolean): AdvancedDynamicTexture;
737
775
  }
738
776
  }
739
777
  declare module "babylonjs-gui/2D/controls/control" {
740
778
  import { Nullable } from "babylonjs/types";
741
779
  import { Observable } from "babylonjs/Misc/observable";
742
780
  import { Vector2, Vector3 } from "babylonjs/Maths/math.vector";
743
- import { PointerInfoBase } from 'babylonjs/Events/pointerEvents';
781
+ import { PointerInfoBase } from "babylonjs/Events/pointerEvents";
744
782
  import { TransformNode } from "babylonjs/Meshes/transformNode";
745
783
  import { Scene } from "babylonjs/scene";
746
784
  import { Container } from "babylonjs-gui/2D/controls/container";
@@ -749,7 +787,7 @@ declare module "babylonjs-gui/2D/controls/control" {
749
787
  import { Measure } from "babylonjs-gui/2D/measure";
750
788
  import { Style } from "babylonjs-gui/2D/style";
751
789
  import { Matrix2D, Vector2WithInfo } from "babylonjs-gui/2D/math2D";
752
- import { ICanvasRenderingContext } from 'babylonjs/Engines/ICanvas';
790
+ import { ICanvasRenderingContext } from "babylonjs/Engines/ICanvas";
753
791
  /**
754
792
  * Root class used for all 2D controls
755
793
  * @see https://doc.babylonjs.com/how_to/gui#controls
@@ -770,6 +808,8 @@ declare module "babylonjs-gui/2D/controls/control" {
770
808
  parent: Nullable<Container>;
771
809
  /** @hidden */
772
810
  _currentMeasure: Measure;
811
+ /** @hidden */
812
+ _tempPaddingMeasure: Measure;
773
813
  private _fontFamily;
774
814
  private _fontStyle;
775
815
  private _fontWeight;
@@ -802,6 +842,7 @@ declare module "babylonjs-gui/2D/controls/control" {
802
842
  _prevCurrentMeasureTransformedIntoGlobalSpace: Measure;
803
843
  /** @hidden */
804
844
  protected _cachedParentMeasure: Measure;
845
+ private _descendantsOnlyPadding;
805
846
  private _paddingLeft;
806
847
  private _paddingRight;
807
848
  private _paddingTop;
@@ -836,6 +877,8 @@ declare module "babylonjs-gui/2D/controls/control" {
836
877
  private _enterCount;
837
878
  private _doNotRender;
838
879
  private _downPointerIds;
880
+ private _evaluatedMeasure;
881
+ private _evaluatedParentMeasure;
839
882
  protected _isEnabled: boolean;
840
883
  protected _disabledColor: string;
841
884
  protected _disabledColorItem: string;
@@ -860,6 +903,10 @@ declare module "babylonjs-gui/2D/controls/control" {
860
903
  */
861
904
  get isReadOnly(): boolean;
862
905
  set isReadOnly(value: boolean);
906
+ /**
907
+ * Gets the transformed measure, that is the bounding box of the control after applying all transformations
908
+ */
909
+ get transformedMeasure(): Measure;
863
910
  /**
864
911
  * Gets or sets an object used to store user defined information for the node
865
912
  */
@@ -916,36 +963,36 @@ declare module "babylonjs-gui/2D/controls/control" {
916
963
  */
917
964
  getClassName(): string;
918
965
  /**
919
- * An event triggered when pointer wheel is scrolled
920
- */
966
+ * An event triggered when pointer wheel is scrolled
967
+ */
921
968
  onWheelObservable: Observable<Vector2>;
922
969
  /**
923
- * An event triggered when the pointer moves over the control.
924
- */
970
+ * An event triggered when the pointer moves over the control.
971
+ */
925
972
  onPointerMoveObservable: Observable<Vector2>;
926
973
  /**
927
- * An event triggered when the pointer moves out of the control.
928
- */
974
+ * An event triggered when the pointer moves out of the control.
975
+ */
929
976
  onPointerOutObservable: Observable<Control>;
930
977
  /**
931
- * An event triggered when the pointer taps the control
932
- */
978
+ * An event triggered when the pointer taps the control
979
+ */
933
980
  onPointerDownObservable: Observable<Vector2WithInfo>;
934
981
  /**
935
- * An event triggered when pointer up
936
- */
982
+ * An event triggered when pointer up
983
+ */
937
984
  onPointerUpObservable: Observable<Vector2WithInfo>;
938
985
  /**
939
- * An event triggered when a control is clicked on
940
- */
986
+ * An event triggered when a control is clicked on
987
+ */
941
988
  onPointerClickObservable: Observable<Vector2WithInfo>;
942
989
  /**
943
- * An event triggered when pointer enters the control
944
- */
990
+ * An event triggered when pointer enters the control
991
+ */
945
992
  onPointerEnterObservable: Observable<Control>;
946
993
  /**
947
- * An event triggered when the control is marked as dirty
948
- */
994
+ * An event triggered when the control is marked as dirty
995
+ */
949
996
  onDirtyObservable: Observable<Control>;
950
997
  /**
951
998
  * An event triggered before drawing the control
@@ -956,8 +1003,8 @@ declare module "babylonjs-gui/2D/controls/control" {
956
1003
  */
957
1004
  onAfterDrawObservable: Observable<Control>;
958
1005
  /**
959
- * An event triggered when the control has been disposed
960
- */
1006
+ * An event triggered when the control has been disposed
1007
+ */
961
1008
  onDisposeObservable: Observable<Control>;
962
1009
  /**
963
1010
  * Get the hosting AdvancedDynamicTexture
@@ -994,27 +1041,27 @@ declare module "babylonjs-gui/2D/controls/control" {
994
1041
  set highlightColor(value: string);
995
1042
  /** Gets or sets a value indicating the scale factor on X axis (1 by default)
996
1043
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
997
- */
1044
+ */
998
1045
  get scaleX(): number;
999
1046
  set scaleX(value: number);
1000
1047
  /** Gets or sets a value indicating the scale factor on Y axis (1 by default)
1001
1048
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
1002
- */
1049
+ */
1003
1050
  get scaleY(): number;
1004
1051
  set scaleY(value: number);
1005
1052
  /** Gets or sets the rotation angle (0 by default)
1006
1053
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
1007
- */
1054
+ */
1008
1055
  get rotation(): number;
1009
1056
  set rotation(value: number);
1010
1057
  /** Gets or sets the transformation center on Y axis (0 by default)
1011
1058
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
1012
- */
1059
+ */
1013
1060
  get transformCenterY(): number;
1014
1061
  set transformCenterY(value: number);
1015
1062
  /** Gets or sets the transformation center on X axis (0 by default)
1016
1063
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
1017
- */
1064
+ */
1018
1065
  get transformCenterX(): number;
1019
1066
  set transformCenterX(value: number);
1020
1067
  /**
@@ -1102,6 +1149,12 @@ declare module "babylonjs-gui/2D/controls/control" {
1102
1149
  * Gets the current linked mesh (or null if none)
1103
1150
  */
1104
1151
  get linkedMesh(): Nullable<TransformNode>;
1152
+ /**
1153
+ * Gets or sets a value indicating the padding should work like in CSS.
1154
+ * Basically, it will add the padding amount on each side of the parent control for its children.
1155
+ */
1156
+ get descendantsOnlyPadding(): boolean;
1157
+ set descendantsOnlyPadding(value: boolean);
1105
1158
  /**
1106
1159
  * Gets or sets a value indicating the padding to use on the left of the control
1107
1160
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -1114,6 +1167,8 @@ declare module "babylonjs-gui/2D/controls/control" {
1114
1167
  */
1115
1168
  get paddingLeftInPixels(): number;
1116
1169
  set paddingLeftInPixels(value: number);
1170
+ /** @hidden */
1171
+ get _paddingLeftInPixels(): number;
1117
1172
  /**
1118
1173
  * Gets or sets a value indicating the padding to use on the right of the control
1119
1174
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -1126,6 +1181,8 @@ declare module "babylonjs-gui/2D/controls/control" {
1126
1181
  */
1127
1182
  get paddingRightInPixels(): number;
1128
1183
  set paddingRightInPixels(value: number);
1184
+ /** @hidden */
1185
+ get _paddingRightInPixels(): number;
1129
1186
  /**
1130
1187
  * Gets or sets a value indicating the padding to use on the top of the control
1131
1188
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -1138,6 +1195,8 @@ declare module "babylonjs-gui/2D/controls/control" {
1138
1195
  */
1139
1196
  get paddingTopInPixels(): number;
1140
1197
  set paddingTopInPixels(value: number);
1198
+ /** @hidden */
1199
+ get _paddingTopInPixels(): number;
1141
1200
  /**
1142
1201
  * Gets or sets a value indicating the padding to use on the bottom of the control
1143
1202
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -1150,6 +1209,8 @@ declare module "babylonjs-gui/2D/controls/control" {
1150
1209
  */
1151
1210
  get paddingBottomInPixels(): number;
1152
1211
  set paddingBottomInPixels(value: number);
1212
+ /** @hidden */
1213
+ get _paddingBottomInPixels(): number;
1153
1214
  /**
1154
1215
  * Gets or sets a value indicating the left coordinate of the control
1155
1216
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -1211,6 +1272,17 @@ declare module "babylonjs-gui/2D/controls/control" {
1211
1272
  /** Gets or sets front color of control if it's disabled */
1212
1273
  get disabledColorItem(): string;
1213
1274
  set disabledColorItem(value: string);
1275
+ /**
1276
+ * Gets/sets the overlap group of the control.
1277
+ * Controls with overlapGroup set to a number can be deoverlapped.
1278
+ * Controls with overlapGroup set to undefined are not deoverlapped.
1279
+ * @see https://doc.babylonjs.com/how_to/gui#deoverlapping
1280
+ */
1281
+ overlapGroup?: number;
1282
+ /**
1283
+ * Gets/sets the deoverlap movement multiplier
1284
+ */
1285
+ overlapDeltaMultiplier?: number;
1214
1286
  /**
1215
1287
  * Creates a new control
1216
1288
  * @param name defines the name of the control
@@ -1280,13 +1352,13 @@ declare module "babylonjs-gui/2D/controls/control" {
1280
1352
  */
1281
1353
  linkWithMesh(mesh: Nullable<TransformNode>): void;
1282
1354
  /**
1283
- * Shorthand funtion to set the top, right, bottom, and left padding values on the control.
1284
- * @param { string | number} paddingTop - The value of the top padding.
1285
- * @param { string | number} paddingRight - The value of the right padding. If omitted, top is used.
1286
- * @param { string | number} paddingBottom - The value of the bottom padding. If omitted, top is used.
1287
- * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.
1288
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
1289
- */
1355
+ * Shorthand funtion to set the top, right, bottom, and left padding values on the control.
1356
+ * @param { string | number} paddingTop - The value of the top padding.
1357
+ * @param { string | number} paddingRight - The value of the right padding. If omitted, top is used.
1358
+ * @param { string | number} paddingBottom - The value of the bottom padding. If omitted, top is used.
1359
+ * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.
1360
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
1361
+ */
1290
1362
  setPadding(paddingTop: string | number, paddingRight?: string | number, paddingBottom?: string | number, paddingLeft?: string | number): void;
1291
1363
  /**
1292
1364
  * Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.
@@ -2072,13 +2144,19 @@ declare module "babylonjs-gui/2D/controls/stackPanel" {
2072
2144
  private _manualWidth;
2073
2145
  private _manualHeight;
2074
2146
  private _doNotTrackManualChanges;
2147
+ private _spacing;
2075
2148
  /**
2076
- * Gets or sets a boolean indicating that layou warnings should be ignored
2149
+ * Gets or sets a boolean indicating that layout warnings should be ignored
2077
2150
  */
2078
2151
  ignoreLayoutWarnings: boolean;
2079
2152
  /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
2080
2153
  get isVertical(): boolean;
2081
2154
  set isVertical(value: boolean);
2155
+ /**
2156
+ * Gets or sets the spacing (in pixels) between each child.
2157
+ */
2158
+ get spacing(): number;
2159
+ set spacing(value: number);
2082
2160
  /**
2083
2161
  * Gets or sets panel width.
2084
2162
  * This value should not be set when in horizontal mode as it will be computed automatically
@@ -2472,7 +2550,9 @@ declare module "babylonjs-gui/2D/controls/grid" {
2472
2550
  export class Grid extends Container {
2473
2551
  name?: string | undefined;
2474
2552
  private _rowDefinitions;
2553
+ private _rowDefinitionObservers;
2475
2554
  private _columnDefinitions;
2555
+ private _columnDefinitionObservers;
2476
2556
  private _cells;
2477
2557
  private _childControls;
2478
2558
  /**
@@ -2585,9 +2665,9 @@ declare module "babylonjs-gui/2D/controls/grid" {
2585
2665
  /** Releases associated resources */
2586
2666
  dispose(): void;
2587
2667
  /**
2588
- * Serializes the current control
2589
- * @param serializationObject defined the JSON serialized object
2590
- */
2668
+ * Serializes the current control
2669
+ * @param serializationObject defined the JSON serialized object
2670
+ */
2591
2671
  serialize(serializationObject: any): void;
2592
2672
  /** @hidden */
2593
2673
  _parseFromContent(serializedObject: any, host: AdvancedDynamicTexture): void;
@@ -4124,6 +4204,7 @@ declare module "babylonjs-gui/3D/gui3DManager" {
4124
4204
  private _rootContainer;
4125
4205
  private _pointerObserver;
4126
4206
  private _pointerOutObserver;
4207
+ private _customControlScaling;
4127
4208
  /** @hidden */
4128
4209
  _lastPickedControl: Control3D;
4129
4210
  /** @hidden */
@@ -4134,6 +4215,7 @@ declare module "babylonjs-gui/3D/gui3DManager" {
4134
4215
  _lastControlDown: {
4135
4216
  [pointerId: number]: Control3D;
4136
4217
  };
4218
+ protected static MRTK_REALISTIC_SCALING: number;
4137
4219
  /**
4138
4220
  * Observable raised when the point picked by the pointer events changed
4139
4221
  */
@@ -4154,6 +4236,14 @@ declare module "babylonjs-gui/3D/gui3DManager" {
4154
4236
  get scene(): Scene;
4155
4237
  /** Gets associated utility layer */
4156
4238
  get utilityLayer(): Nullable<UtilityLayerRenderer>;
4239
+ /** Gets the scaling for all UI elements owned by this manager */
4240
+ get controlScaling(): number;
4241
+ /** Sets the scaling adjustment for all UI elements owned by this manager */
4242
+ set controlScaling(newScale: number);
4243
+ /** Gets if controls attached to this manager are realistically sized, based on the fact that 1 unit length is 1 meter */
4244
+ get useRealisticScaling(): boolean;
4245
+ /** Sets if controls attached to this manager are realistically sized, based on the fact that 1 unit length is 1 meter */
4246
+ set useRealisticScaling(newValue: boolean);
4157
4247
  /**
4158
4248
  * Creates a new GUI3DManager
4159
4249
  * @param scene
@@ -4308,6 +4398,8 @@ declare module "babylonjs-gui/3D/controls/control3D" {
4308
4398
  private _enterCount;
4309
4399
  private _downPointerIds;
4310
4400
  private _isVisible;
4401
+ /** @hidden */
4402
+ _isScaledByManager: boolean;
4311
4403
  /** Gets or sets the control position in world space */
4312
4404
  get position(): Vector3;
4313
4405
  set position(value: Vector3);
@@ -7093,21 +7185,24 @@ declare module BABYLON.GUI {
7093
7185
  * Class used to specific a value and its associated unit
7094
7186
  */
7095
7187
  export class ValueAndUnit {
7096
- /** defines the unit to store */
7097
- unit: number;
7098
7188
  /** defines a boolean indicating if the value can be negative */
7099
7189
  negativeValueAllowed: boolean;
7100
7190
  private _value;
7191
+ private _unit;
7101
7192
  private _originalUnit;
7102
7193
  /**
7103
7194
  * Gets or sets a value indicating that this value will not scale accordingly with adaptive scaling property
7104
7195
  * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7105
7196
  */
7106
7197
  ignoreAdaptiveScaling: boolean;
7198
+ /**
7199
+ * BABYLON.Observable event triggered each time the value or unit changes
7200
+ */
7201
+ onChangedObservable: BABYLON.Observable<void>;
7107
7202
  /**
7108
7203
  * Creates a new ValueAndUnit
7109
7204
  * @param value defines the value to store
7110
- * @param unit defines the unit to store
7205
+ * @param unit defines the unit to store - defaults to ValueAndUnit.UNITMODE_PIXEL
7111
7206
  * @param negativeValueAllowed defines a boolean indicating if the value can be negative
7112
7207
  */
7113
7208
  constructor(value: number,
@@ -7119,8 +7214,19 @@ declare module BABYLON.GUI {
7119
7214
  get isPercentage(): boolean;
7120
7215
  /** Gets a boolean indicating if the value is store as pixel */
7121
7216
  get isPixel(): boolean;
7122
- /** Gets direct internal value */
7217
+ /**
7218
+ * Gets value (without units)
7219
+ * @deprecated use value property instead
7220
+ */
7123
7221
  get internalValue(): number;
7222
+ /** Gets value (without units) */
7223
+ get value(): number;
7224
+ /** Sets value (without units) */
7225
+ set value(value: number);
7226
+ /** Gets units (without value) */
7227
+ get unit(): number;
7228
+ /** Sets units (without value) */
7229
+ set unit(value: number);
7124
7230
  /**
7125
7231
  * Gets value as pixel
7126
7232
  * @param host defines the root host
@@ -7129,7 +7235,7 @@ declare module BABYLON.GUI {
7129
7235
  */
7130
7236
  getValueInPixel(host: AdvancedDynamicTexture, refValue: number): number;
7131
7237
  /**
7132
- * Update the current value and unit. This should be done cautiously as the GUi won't be marked as dirty with this function.
7238
+ * Update the current value and unit.
7133
7239
  * @param value defines the value to store
7134
7240
  * @param unit defines the unit to store
7135
7241
  * @returns the current ValueAndUnit
@@ -7151,7 +7257,7 @@ declare module BABYLON.GUI {
7151
7257
  /**
7152
7258
  * Store a value parsed from a string
7153
7259
  * @param source defines the source string
7154
- * @returns true if the value was successfully parsed
7260
+ * @returns true if the value was successfully parsed and updated
7155
7261
  */
7156
7262
  fromString(source: string | number): boolean;
7157
7263
  private static _Regex;
@@ -7279,6 +7385,11 @@ declare module BABYLON.GUI {
7279
7385
  * @returns a new matrix
7280
7386
  */
7281
7387
  static Identity(): Matrix2D;
7388
+ /**
7389
+ * Creates an identity matrix and stores it in a target matrix
7390
+ * @param result defines the target matrix
7391
+ */
7392
+ static IdentityToRef(result: Matrix2D): void;
7282
7393
  /**
7283
7394
  * Creates a translation matrix and stores it in a target matrix
7284
7395
  * @param x defines the x coordinate of the translation
@@ -7399,12 +7510,14 @@ declare module BABYLON.GUI {
7399
7510
  }
7400
7511
  declare module BABYLON.GUI {
7401
7512
  /**
7402
- * Class used to create texture to support 2D GUI elements
7403
- * @see https://doc.babylonjs.com/how_to/gui
7404
- */
7513
+ * Class used to create texture to support 2D GUI elements
7514
+ * @see https://doc.babylonjs.com/how_to/gui
7515
+ */
7405
7516
  export class AdvancedDynamicTexture extends BABYLON.DynamicTexture {
7406
7517
  /** Define the Uurl to load snippets */
7407
7518
  static SnippetUrl: string;
7519
+ /** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */
7520
+ static AllowGPUOptimizations: boolean;
7408
7521
  /** Snippet ID if the content was created from the snippet server */
7409
7522
  snippetId: string;
7410
7523
  private _isDirty;
@@ -7459,152 +7572,152 @@ declare module BABYLON.GUI {
7459
7572
  /** Gets the number of render calls made the last time the ADT has been rendered */
7460
7573
  get numRenderCalls(): number;
7461
7574
  /**
7462
- * Define type to string to ensure compatibility across browsers
7463
- * Safari doesn't support DataTransfer constructor
7464
- */
7575
+ * Define type to string to ensure compatibility across browsers
7576
+ * Safari doesn't support DataTransfer constructor
7577
+ */
7465
7578
  private _clipboardData;
7466
7579
  /**
7467
- * BABYLON.Observable event triggered each time an clipboard event is received from the rendering canvas
7468
- */
7580
+ * BABYLON.Observable event triggered each time an clipboard event is received from the rendering canvas
7581
+ */
7469
7582
  onClipboardObservable: BABYLON.Observable<BABYLON.ClipboardInfo>;
7470
7583
  /**
7471
- * BABYLON.Observable event triggered each time a pointer down is intercepted by a control
7472
- */
7584
+ * BABYLON.Observable event triggered each time a pointer down is intercepted by a control
7585
+ */
7473
7586
  onControlPickedObservable: BABYLON.Observable<Control>;
7474
7587
  /**
7475
- * BABYLON.Observable event triggered before layout is evaluated
7476
- */
7588
+ * BABYLON.Observable event triggered before layout is evaluated
7589
+ */
7477
7590
  onBeginLayoutObservable: BABYLON.Observable<AdvancedDynamicTexture>;
7478
7591
  /**
7479
- * BABYLON.Observable event triggered after the layout was evaluated
7480
- */
7592
+ * BABYLON.Observable event triggered after the layout was evaluated
7593
+ */
7481
7594
  onEndLayoutObservable: BABYLON.Observable<AdvancedDynamicTexture>;
7482
7595
  /**
7483
- * BABYLON.Observable event triggered before the texture is rendered
7484
- */
7596
+ * BABYLON.Observable event triggered before the texture is rendered
7597
+ */
7485
7598
  onBeginRenderObservable: BABYLON.Observable<AdvancedDynamicTexture>;
7486
7599
  /**
7487
- * BABYLON.Observable event triggered after the texture was rendered
7488
- */
7600
+ * BABYLON.Observable event triggered after the texture was rendered
7601
+ */
7489
7602
  onEndRenderObservable: BABYLON.Observable<AdvancedDynamicTexture>;
7490
7603
  /**
7491
- * Gets or sets a boolean defining if alpha is stored as premultiplied
7492
- */
7604
+ * Gets or sets a boolean defining if alpha is stored as premultiplied
7605
+ */
7493
7606
  premulAlpha: boolean;
7494
7607
  /**
7495
7608
  * Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture
7496
7609
  */
7497
7610
  applyYInversionOnUpdate: boolean;
7498
7611
  /**
7499
- * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
7500
- * Useful when you want more antialiasing
7501
- */
7612
+ * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
7613
+ * Useful when you want more antialiasing
7614
+ */
7502
7615
  get renderScale(): number;
7503
7616
  set renderScale(value: number);
7504
7617
  /** Gets or sets the background color */
7505
7618
  get background(): string;
7506
7619
  set background(value: string);
7507
7620
  /**
7508
- * Gets or sets the ideal width used to design controls.
7509
- * The GUI will then rescale everything accordingly
7510
- * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7511
- */
7621
+ * Gets or sets the ideal width used to design controls.
7622
+ * The GUI will then rescale everything accordingly
7623
+ * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7624
+ */
7512
7625
  get idealWidth(): number;
7513
7626
  set idealWidth(value: number);
7514
7627
  /**
7515
- * Gets or sets the ideal height used to design controls.
7516
- * The GUI will then rescale everything accordingly
7517
- * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7518
- */
7628
+ * Gets or sets the ideal height used to design controls.
7629
+ * The GUI will then rescale everything accordingly
7630
+ * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7631
+ */
7519
7632
  get idealHeight(): number;
7520
7633
  set idealHeight(value: number);
7521
7634
  /**
7522
- * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
7523
- * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7524
- */
7635
+ * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
7636
+ * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7637
+ */
7525
7638
  get useSmallestIdeal(): boolean;
7526
7639
  set useSmallestIdeal(value: boolean);
7527
7640
  /**
7528
- * Gets or sets a boolean indicating if adaptive scaling must be used
7529
- * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7530
- */
7641
+ * Gets or sets a boolean indicating if adaptive scaling must be used
7642
+ * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7643
+ */
7531
7644
  get renderAtIdealSize(): boolean;
7532
7645
  set renderAtIdealSize(value: boolean);
7533
7646
  /**
7534
7647
  * Gets the ratio used when in "ideal mode"
7535
- * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7648
+ * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
7536
7649
  * */
7537
7650
  get idealRatio(): number;
7538
7651
  /**
7539
- * Gets the underlying layer used to render the texture when in fullscreen mode
7540
- */
7652
+ * Gets the underlying layer used to render the texture when in fullscreen mode
7653
+ */
7541
7654
  get layer(): BABYLON.Nullable<BABYLON.Layer>;
7542
7655
  /**
7543
- * Gets the root container control
7544
- */
7656
+ * Gets the root container control
7657
+ */
7545
7658
  get rootContainer(): Container;
7546
7659
  /**
7547
- * Returns an array containing the root container.
7548
- * This is mostly used to let the Inspector introspects the ADT
7549
- * @returns an array containing the rootContainer
7550
- */
7660
+ * Returns an array containing the root container.
7661
+ * This is mostly used to let the Inspector introspects the ADT
7662
+ * @returns an array containing the rootContainer
7663
+ */
7551
7664
  getChildren(): Array<Container>;
7552
7665
  /**
7553
- * Will return all controls that are inside this texture
7554
- * @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
7555
- * @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
7556
- * @return all child controls
7557
- */
7666
+ * Will return all controls that are inside this texture
7667
+ * @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
7668
+ * @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
7669
+ * @return all child controls
7670
+ */
7558
7671
  getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[];
7559
7672
  /**
7560
- * Will return all controls with the given type name
7561
- * @param typeName defines the type name to search for
7562
- * @returns an array of all controls found
7563
- */
7673
+ * Will return all controls with the given type name
7674
+ * @param typeName defines the type name to search for
7675
+ * @returns an array of all controls found
7676
+ */
7564
7677
  getControlsByType(typeName: string): Control[];
7565
7678
  /**
7566
- * Will return the first control with the given name
7567
- * @param name defines the name to search for
7568
- * @return the first control found or null
7569
- */
7679
+ * Will return the first control with the given name
7680
+ * @param name defines the name to search for
7681
+ * @return the first control found or null
7682
+ */
7570
7683
  getControlByName(name: string): BABYLON.Nullable<Control>;
7571
7684
  private _getControlByKey;
7572
7685
  /**
7573
- * Gets or sets the current focused control
7574
- */
7686
+ * Gets or sets the current focused control
7687
+ */
7575
7688
  get focusedControl(): BABYLON.Nullable<IFocusableControl>;
7576
7689
  set focusedControl(control: BABYLON.Nullable<IFocusableControl>);
7577
7690
  /**
7578
- * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
7579
- */
7691
+ * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
7692
+ */
7580
7693
  get isForeground(): boolean;
7581
7694
  set isForeground(value: boolean);
7582
7695
  /**
7583
- * Gets or set information about clipboardData
7584
- */
7696
+ * Gets or set information about clipboardData
7697
+ */
7585
7698
  get clipboardData(): string;
7586
7699
  set clipboardData(value: string);
7587
7700
  /**
7588
- * Creates a new AdvancedDynamicTexture
7589
- * @param name defines the name of the texture
7590
- * @param width defines the width of the texture
7591
- * @param height defines the height of the texture
7592
- * @param scene defines the hosting scene
7593
- * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
7594
- * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
7595
- * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
7596
- */
7701
+ * Creates a new AdvancedDynamicTexture
7702
+ * @param name defines the name of the texture
7703
+ * @param width defines the width of the texture
7704
+ * @param height defines the height of the texture
7705
+ * @param scene defines the hosting scene
7706
+ * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
7707
+ * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
7708
+ * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
7709
+ */
7597
7710
  constructor(name: string, width: number | undefined, height: number | undefined, scene: BABYLON.Nullable<BABYLON.Scene>, generateMipMaps?: boolean, samplingMode?: number, invertY?: boolean);
7598
7711
  /**
7599
- * Get the current class name of the texture useful for serialization or dynamic coding.
7600
- * @returns "AdvancedDynamicTexture"
7601
- */
7712
+ * Get the current class name of the texture useful for serialization or dynamic coding.
7713
+ * @returns "AdvancedDynamicTexture"
7714
+ */
7602
7715
  getClassName(): string;
7603
7716
  /**
7604
- * Function used to execute a function on all controls
7605
- * @param func defines the function to execute
7606
- * @param container defines the container where controls belong. If null the root container will be used
7607
- */
7717
+ * Function used to execute a function on all controls
7718
+ * @param func defines the function to execute
7719
+ * @param container defines the container where controls belong. If null the root container will be used
7720
+ */
7608
7721
  executeOnAllControls(func: (control: Control) => void, container?: Container): void;
7609
7722
  private _useInvalidateRectOptimization;
7610
7723
  /**
@@ -7622,47 +7735,55 @@ declare module BABYLON.GUI {
7622
7735
  */
7623
7736
  invalidateRect(invalidMinX: number, invalidMinY: number, invalidMaxX: number, invalidMaxY: number): void;
7624
7737
  /**
7625
- * Marks the texture as dirty forcing a complete update
7626
- */
7738
+ * Marks the texture as dirty forcing a complete update
7739
+ */
7627
7740
  markAsDirty(): void;
7628
7741
  /**
7629
- * Helper function used to create a new style
7630
- * @returns a new style
7631
- * @see https://doc.babylonjs.com/how_to/gui#styles
7632
- */
7742
+ * Helper function used to create a new style
7743
+ * @returns a new style
7744
+ * @see https://doc.babylonjs.com/how_to/gui#styles
7745
+ */
7633
7746
  createStyle(): Style;
7634
7747
  /**
7635
- * Adds a new control to the root container
7636
- * @param control defines the control to add
7637
- * @returns the current texture
7638
- */
7748
+ * Adds a new control to the root container
7749
+ * @param control defines the control to add
7750
+ * @returns the current texture
7751
+ */
7639
7752
  addControl(control: Control): AdvancedDynamicTexture;
7640
7753
  /**
7641
- * Removes a control from the root container
7642
- * @param control defines the control to remove
7643
- * @returns the current texture
7644
- */
7754
+ * Removes a control from the root container
7755
+ * @param control defines the control to remove
7756
+ * @returns the current texture
7757
+ */
7645
7758
  removeControl(control: Control): AdvancedDynamicTexture;
7646
7759
  /**
7647
- * Release all resources
7648
- */
7760
+ * Moves overlapped controls towards a position where it is not overlapping anymore.
7761
+ * Please note that this method alters linkOffsetXInPixels and linkOffsetYInPixels.
7762
+ * @param overlapGroup the overlap group which will be processed or undefined to process all overlap groups
7763
+ * @param deltaStep the step size (speed) to reach the target non overlapping position (default 0.1)
7764
+ * @param repelFactor how much is the control repelled by other controls
7765
+ */
7766
+ moveToNonOverlappedPosition(overlapGroup?: number | Control[], deltaStep?: number, repelFactor?: number): void;
7767
+ /**
7768
+ * Release all resources
7769
+ */
7649
7770
  dispose(): void;
7650
7771
  private _onResize;
7651
7772
  /** @hidden */
7652
7773
  _getGlobalViewport(): BABYLON.Viewport;
7653
7774
  /**
7654
- * Get screen coordinates for a vector3
7655
- * @param position defines the position to project
7656
- * @param worldMatrix defines the world matrix to use
7657
- * @returns the projected position
7658
- */
7775
+ * Get screen coordinates for a vector3
7776
+ * @param position defines the position to project
7777
+ * @param worldMatrix defines the world matrix to use
7778
+ * @returns the projected position
7779
+ */
7659
7780
  getProjectedPosition(position: BABYLON.Vector3, worldMatrix: BABYLON.Matrix): BABYLON.Vector2;
7660
7781
  /**
7661
- * Get screen coordinates for a vector3
7662
- * @param position defines the position to project
7663
- * @param worldMatrix defines the world matrix to use
7664
- * @returns the projected position with Z
7665
- */
7782
+ * Get screen coordinates for a vector3
7783
+ * @param position defines the position to project
7784
+ * @param worldMatrix defines the world matrix to use
7785
+ * @returns the projected position with Z
7786
+ */
7666
7787
  getProjectedPositionWithZ(position: BABYLON.Vector3, worldMatrix: BABYLON.Matrix): BABYLON.Vector3;
7667
7788
  private _checkUpdate;
7668
7789
  private _clearMeasure;
@@ -7687,23 +7808,23 @@ declare module BABYLON.GUI {
7687
7808
  /** @hidden */
7688
7809
  private onClipboardPaste;
7689
7810
  /**
7690
- * Register the clipboard Events onto the canvas
7691
- */
7811
+ * Register the clipboard Events onto the canvas
7812
+ */
7692
7813
  registerClipboardEvents(): void;
7693
7814
  /**
7694
7815
  * Unregister the clipboard Events from the canvas
7695
7816
  */
7696
7817
  unRegisterClipboardEvents(): void;
7697
7818
  /**
7698
- * Connect the texture to a hosting mesh to enable interactions
7699
- * @param mesh defines the mesh to attach to
7700
- * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
7701
- */
7819
+ * Connect the texture to a hosting mesh to enable interactions
7820
+ * @param mesh defines the mesh to attach to
7821
+ * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
7822
+ */
7702
7823
  attachToMesh(mesh: BABYLON.AbstractMesh, supportPointerMove?: boolean): void;
7703
7824
  /**
7704
- * Move the focus to a specific control
7705
- * @param control defines the control which will receive the focus
7706
- */
7825
+ * Move the focus to a specific control
7826
+ * @param control defines the control which will receive the focus
7827
+ */
7707
7828
  moveFocusToControl(control: IFocusableControl): void;
7708
7829
  private _manageFocus;
7709
7830
  private _attachToOnPointerOut;
@@ -7727,12 +7848,19 @@ declare module BABYLON.GUI {
7727
7848
  */
7728
7849
  parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean): Promise<void>;
7729
7850
  /**
7730
- * Recreate the content of the ADT from a url json
7731
- * @param url defines the url to load
7732
- * @param scaleToSize defines whether to scale to texture to the saved size
7733
- * @returns a promise that will resolve on success
7734
- */
7851
+ * Recreate the content of the ADT from a url json
7852
+ * @param url defines the url to load
7853
+ * @param scaleToSize defines whether to scale to texture to the saved size
7854
+ * @returns a promise that will resolve on success
7855
+ */
7735
7856
  parseFromURLAsync(url: string, scaleToSize?: boolean): Promise<void>;
7857
+ /**
7858
+ * Compares two rectangle based controls for pixel overlap
7859
+ * @param control1 The first control to compare
7860
+ * @param control2 The second control to compare
7861
+ * @returns true if overlaps, otherwise false
7862
+ */
7863
+ private static _Overlaps;
7736
7864
  /**
7737
7865
  * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
7738
7866
  * @param mesh defines the mesh which will receive the texture
@@ -7755,18 +7883,19 @@ declare module BABYLON.GUI {
7755
7883
  */
7756
7884
  static CreateForMeshTexture(mesh: BABYLON.AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, invertY?: boolean): AdvancedDynamicTexture;
7757
7885
  /**
7758
- * Creates a new AdvancedDynamicTexture in fullscreen mode.
7759
- * In this mode the texture will rely on a layer for its rendering.
7760
- * This allows it to be treated like any other layer.
7761
- * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
7762
- * LayerMask is set through advancedTexture.layer.layerMask
7763
- * @param name defines name for the texture
7764
- * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
7765
- * @param scene defines the hosting scene
7766
- * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
7767
- * @returns a new AdvancedDynamicTexture
7768
- */
7769
- static CreateFullscreenUI(name: string, foreground?: boolean, scene?: BABYLON.Nullable<BABYLON.Scene>, sampling?: number): AdvancedDynamicTexture;
7886
+ * Creates a new AdvancedDynamicTexture in fullscreen mode.
7887
+ * In this mode the texture will rely on a layer for its rendering.
7888
+ * This allows it to be treated like any other layer.
7889
+ * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
7890
+ * LayerMask is set through advancedTexture.layer.layerMask
7891
+ * @param name defines name for the texture
7892
+ * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
7893
+ * @param scene defines the hosting scene
7894
+ * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
7895
+ * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)
7896
+ * @returns a new AdvancedDynamicTexture
7897
+ */
7898
+ static CreateFullscreenUI(name: string, foreground?: boolean, scene?: BABYLON.Nullable<BABYLON.Scene>, sampling?: number, adaptiveScaling?: boolean): AdvancedDynamicTexture;
7770
7899
  }
7771
7900
  }
7772
7901
  declare module BABYLON.GUI {
@@ -7790,6 +7919,8 @@ declare module BABYLON.GUI {
7790
7919
  parent: BABYLON.Nullable<Container>;
7791
7920
  /** @hidden */
7792
7921
  _currentMeasure: Measure;
7922
+ /** @hidden */
7923
+ _tempPaddingMeasure: Measure;
7793
7924
  private _fontFamily;
7794
7925
  private _fontStyle;
7795
7926
  private _fontWeight;
@@ -7822,6 +7953,7 @@ declare module BABYLON.GUI {
7822
7953
  _prevCurrentMeasureTransformedIntoGlobalSpace: Measure;
7823
7954
  /** @hidden */
7824
7955
  protected _cachedParentMeasure: Measure;
7956
+ private _descendantsOnlyPadding;
7825
7957
  private _paddingLeft;
7826
7958
  private _paddingRight;
7827
7959
  private _paddingTop;
@@ -7856,6 +7988,8 @@ declare module BABYLON.GUI {
7856
7988
  private _enterCount;
7857
7989
  private _doNotRender;
7858
7990
  private _downPointerIds;
7991
+ private _evaluatedMeasure;
7992
+ private _evaluatedParentMeasure;
7859
7993
  protected _isEnabled: boolean;
7860
7994
  protected _disabledColor: string;
7861
7995
  protected _disabledColorItem: string;
@@ -7880,6 +8014,10 @@ declare module BABYLON.GUI {
7880
8014
  */
7881
8015
  get isReadOnly(): boolean;
7882
8016
  set isReadOnly(value: boolean);
8017
+ /**
8018
+ * Gets the transformed measure, that is the bounding box of the control after applying all transformations
8019
+ */
8020
+ get transformedMeasure(): Measure;
7883
8021
  /**
7884
8022
  * Gets or sets an object used to store user defined information for the node
7885
8023
  */
@@ -7936,36 +8074,36 @@ declare module BABYLON.GUI {
7936
8074
  */
7937
8075
  getClassName(): string;
7938
8076
  /**
7939
- * An event triggered when pointer wheel is scrolled
7940
- */
8077
+ * An event triggered when pointer wheel is scrolled
8078
+ */
7941
8079
  onWheelObservable: BABYLON.Observable<BABYLON.Vector2>;
7942
8080
  /**
7943
- * An event triggered when the pointer moves over the control.
7944
- */
8081
+ * An event triggered when the pointer moves over the control.
8082
+ */
7945
8083
  onPointerMoveObservable: BABYLON.Observable<BABYLON.Vector2>;
7946
8084
  /**
7947
- * An event triggered when the pointer moves out of the control.
7948
- */
8085
+ * An event triggered when the pointer moves out of the control.
8086
+ */
7949
8087
  onPointerOutObservable: BABYLON.Observable<Control>;
7950
8088
  /**
7951
- * An event triggered when the pointer taps the control
7952
- */
8089
+ * An event triggered when the pointer taps the control
8090
+ */
7953
8091
  onPointerDownObservable: BABYLON.Observable<Vector2WithInfo>;
7954
8092
  /**
7955
- * An event triggered when pointer up
7956
- */
8093
+ * An event triggered when pointer up
8094
+ */
7957
8095
  onPointerUpObservable: BABYLON.Observable<Vector2WithInfo>;
7958
8096
  /**
7959
- * An event triggered when a control is clicked on
7960
- */
8097
+ * An event triggered when a control is clicked on
8098
+ */
7961
8099
  onPointerClickObservable: BABYLON.Observable<Vector2WithInfo>;
7962
8100
  /**
7963
- * An event triggered when pointer enters the control
7964
- */
8101
+ * An event triggered when pointer enters the control
8102
+ */
7965
8103
  onPointerEnterObservable: BABYLON.Observable<Control>;
7966
8104
  /**
7967
- * An event triggered when the control is marked as dirty
7968
- */
8105
+ * An event triggered when the control is marked as dirty
8106
+ */
7969
8107
  onDirtyObservable: BABYLON.Observable<Control>;
7970
8108
  /**
7971
8109
  * An event triggered before drawing the control
@@ -7976,8 +8114,8 @@ declare module BABYLON.GUI {
7976
8114
  */
7977
8115
  onAfterDrawObservable: BABYLON.Observable<Control>;
7978
8116
  /**
7979
- * An event triggered when the control has been disposed
7980
- */
8117
+ * An event triggered when the control has been disposed
8118
+ */
7981
8119
  onDisposeObservable: BABYLON.Observable<Control>;
7982
8120
  /**
7983
8121
  * Get the hosting AdvancedDynamicTexture
@@ -8014,27 +8152,27 @@ declare module BABYLON.GUI {
8014
8152
  set highlightColor(value: string);
8015
8153
  /** Gets or sets a value indicating the scale factor on X axis (1 by default)
8016
8154
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
8017
- */
8155
+ */
8018
8156
  get scaleX(): number;
8019
8157
  set scaleX(value: number);
8020
8158
  /** Gets or sets a value indicating the scale factor on Y axis (1 by default)
8021
8159
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
8022
- */
8160
+ */
8023
8161
  get scaleY(): number;
8024
8162
  set scaleY(value: number);
8025
8163
  /** Gets or sets the rotation angle (0 by default)
8026
8164
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
8027
- */
8165
+ */
8028
8166
  get rotation(): number;
8029
8167
  set rotation(value: number);
8030
8168
  /** Gets or sets the transformation center on Y axis (0 by default)
8031
8169
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
8032
- */
8170
+ */
8033
8171
  get transformCenterY(): number;
8034
8172
  set transformCenterY(value: number);
8035
8173
  /** Gets or sets the transformation center on X axis (0 by default)
8036
8174
  * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
8037
- */
8175
+ */
8038
8176
  get transformCenterX(): number;
8039
8177
  set transformCenterX(value: number);
8040
8178
  /**
@@ -8122,6 +8260,12 @@ declare module BABYLON.GUI {
8122
8260
  * Gets the current linked mesh (or null if none)
8123
8261
  */
8124
8262
  get linkedMesh(): BABYLON.Nullable<BABYLON.TransformNode>;
8263
+ /**
8264
+ * Gets or sets a value indicating the padding should work like in CSS.
8265
+ * Basically, it will add the padding amount on each side of the parent control for its children.
8266
+ */
8267
+ get descendantsOnlyPadding(): boolean;
8268
+ set descendantsOnlyPadding(value: boolean);
8125
8269
  /**
8126
8270
  * Gets or sets a value indicating the padding to use on the left of the control
8127
8271
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -8134,6 +8278,8 @@ declare module BABYLON.GUI {
8134
8278
  */
8135
8279
  get paddingLeftInPixels(): number;
8136
8280
  set paddingLeftInPixels(value: number);
8281
+ /** @hidden */
8282
+ get _paddingLeftInPixels(): number;
8137
8283
  /**
8138
8284
  * Gets or sets a value indicating the padding to use on the right of the control
8139
8285
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -8146,6 +8292,8 @@ declare module BABYLON.GUI {
8146
8292
  */
8147
8293
  get paddingRightInPixels(): number;
8148
8294
  set paddingRightInPixels(value: number);
8295
+ /** @hidden */
8296
+ get _paddingRightInPixels(): number;
8149
8297
  /**
8150
8298
  * Gets or sets a value indicating the padding to use on the top of the control
8151
8299
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -8158,6 +8306,8 @@ declare module BABYLON.GUI {
8158
8306
  */
8159
8307
  get paddingTopInPixels(): number;
8160
8308
  set paddingTopInPixels(value: number);
8309
+ /** @hidden */
8310
+ get _paddingTopInPixels(): number;
8161
8311
  /**
8162
8312
  * Gets or sets a value indicating the padding to use on the bottom of the control
8163
8313
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -8170,6 +8320,8 @@ declare module BABYLON.GUI {
8170
8320
  */
8171
8321
  get paddingBottomInPixels(): number;
8172
8322
  set paddingBottomInPixels(value: number);
8323
+ /** @hidden */
8324
+ get _paddingBottomInPixels(): number;
8173
8325
  /**
8174
8326
  * Gets or sets a value indicating the left coordinate of the control
8175
8327
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
@@ -8231,6 +8383,17 @@ declare module BABYLON.GUI {
8231
8383
  /** Gets or sets front color of control if it's disabled */
8232
8384
  get disabledColorItem(): string;
8233
8385
  set disabledColorItem(value: string);
8386
+ /**
8387
+ * Gets/sets the overlap group of the control.
8388
+ * Controls with overlapGroup set to a number can be deoverlapped.
8389
+ * Controls with overlapGroup set to undefined are not deoverlapped.
8390
+ * @see https://doc.babylonjs.com/how_to/gui#deoverlapping
8391
+ */
8392
+ overlapGroup?: number;
8393
+ /**
8394
+ * Gets/sets the deoverlap movement multiplier
8395
+ */
8396
+ overlapDeltaMultiplier?: number;
8234
8397
  /**
8235
8398
  * Creates a new control
8236
8399
  * @param name defines the name of the control
@@ -8300,13 +8463,13 @@ declare module BABYLON.GUI {
8300
8463
  */
8301
8464
  linkWithMesh(mesh: BABYLON.Nullable<BABYLON.TransformNode>): void;
8302
8465
  /**
8303
- * Shorthand funtion to set the top, right, bottom, and left padding values on the control.
8304
- * @param { string | number} paddingTop - The value of the top padding.
8305
- * @param { string | number} paddingRight - The value of the right padding. If omitted, top is used.
8306
- * @param { string | number} paddingBottom - The value of the bottom padding. If omitted, top is used.
8307
- * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.
8308
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
8309
- */
8466
+ * Shorthand funtion to set the top, right, bottom, and left padding values on the control.
8467
+ * @param { string | number} paddingTop - The value of the top padding.
8468
+ * @param { string | number} paddingRight - The value of the right padding. If omitted, top is used.
8469
+ * @param { string | number} paddingBottom - The value of the bottom padding. If omitted, top is used.
8470
+ * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.
8471
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
8472
+ */
8310
8473
  setPadding(paddingTop: string | number, paddingRight?: string | number, paddingBottom?: string | number, paddingLeft?: string | number): void;
8311
8474
  /**
8312
8475
  * Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.
@@ -9061,13 +9224,19 @@ declare module BABYLON.GUI {
9061
9224
  private _manualWidth;
9062
9225
  private _manualHeight;
9063
9226
  private _doNotTrackManualChanges;
9227
+ private _spacing;
9064
9228
  /**
9065
- * Gets or sets a boolean indicating that layou warnings should be ignored
9229
+ * Gets or sets a boolean indicating that layout warnings should be ignored
9066
9230
  */
9067
9231
  ignoreLayoutWarnings: boolean;
9068
9232
  /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
9069
9233
  get isVertical(): boolean;
9070
9234
  set isVertical(value: boolean);
9235
+ /**
9236
+ * Gets or sets the spacing (in pixels) between each child.
9237
+ */
9238
+ get spacing(): number;
9239
+ set spacing(value: number);
9071
9240
  /**
9072
9241
  * Gets or sets panel width.
9073
9242
  * This value should not be set when in horizontal mode as it will be computed automatically
@@ -9431,7 +9600,9 @@ declare module BABYLON.GUI {
9431
9600
  export class Grid extends Container {
9432
9601
  name?: string | undefined;
9433
9602
  private _rowDefinitions;
9603
+ private _rowDefinitionObservers;
9434
9604
  private _columnDefinitions;
9605
+ private _columnDefinitionObservers;
9435
9606
  private _cells;
9436
9607
  private _childControls;
9437
9608
  /**
@@ -9544,9 +9715,9 @@ declare module BABYLON.GUI {
9544
9715
  /** Releases associated resources */
9545
9716
  dispose(): void;
9546
9717
  /**
9547
- * Serializes the current control
9548
- * @param serializationObject defined the JSON serialized object
9549
- */
9718
+ * Serializes the current control
9719
+ * @param serializationObject defined the JSON serialized object
9720
+ */
9550
9721
  serialize(serializationObject: any): void;
9551
9722
  /** @hidden */
9552
9723
  _parseFromContent(serializedObject: any, host: AdvancedDynamicTexture): void;
@@ -10930,6 +11101,7 @@ declare module BABYLON.GUI {
10930
11101
  private _rootContainer;
10931
11102
  private _pointerObserver;
10932
11103
  private _pointerOutObserver;
11104
+ private _customControlScaling;
10933
11105
  /** @hidden */
10934
11106
  _lastPickedControl: Control3D;
10935
11107
  /** @hidden */
@@ -10940,6 +11112,7 @@ declare module BABYLON.GUI {
10940
11112
  _lastControlDown: {
10941
11113
  [pointerId: number]: Control3D;
10942
11114
  };
11115
+ protected static MRTK_REALISTIC_SCALING: number;
10943
11116
  /**
10944
11117
  * BABYLON.Observable raised when the point picked by the pointer events changed
10945
11118
  */
@@ -10960,6 +11133,14 @@ declare module BABYLON.GUI {
10960
11133
  get scene(): BABYLON.Scene;
10961
11134
  /** Gets associated utility layer */
10962
11135
  get utilityLayer(): BABYLON.Nullable<BABYLON.UtilityLayerRenderer>;
11136
+ /** Gets the scaling for all UI elements owned by this manager */
11137
+ get controlScaling(): number;
11138
+ /** Sets the scaling adjustment for all UI elements owned by this manager */
11139
+ set controlScaling(newScale: number);
11140
+ /** Gets if controls attached to this manager are realistically sized, based on the fact that 1 unit length is 1 meter */
11141
+ get useRealisticScaling(): boolean;
11142
+ /** Sets if controls attached to this manager are realistically sized, based on the fact that 1 unit length is 1 meter */
11143
+ set useRealisticScaling(newValue: boolean);
10963
11144
  /**
10964
11145
  * Creates a new GUI3DManager
10965
11146
  * @param scene
@@ -11092,6 +11273,8 @@ declare module BABYLON.GUI {
11092
11273
  private _enterCount;
11093
11274
  private _downPointerIds;
11094
11275
  private _isVisible;
11276
+ /** @hidden */
11277
+ _isScaledByManager: boolean;
11095
11278
  /** Gets or sets the control position in world space */
11096
11279
  get position(): BABYLON.Vector3;
11097
11280
  set position(value: BABYLON.Vector3);