babylonjs-gui 5.0.0-beta.1 → 5.0.0-beta.12

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.
@@ -583,7 +583,7 @@ declare module "babylonjs-gui/2D/advancedDynamicTexture" {
583
583
  * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
584
584
  * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
585
585
  */
586
- constructor(name: string, width: number | undefined, height: number | undefined, scene: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number, invertY?: boolean);
586
+ constructor(name: string, width?: number, height?: number, scene?: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number, invertY?: boolean);
587
587
  /**
588
588
  * Get the current class name of the texture useful for serialization or dynamic coding.
589
589
  * @returns "AdvancedDynamicTexture"
@@ -772,7 +772,19 @@ declare module "babylonjs-gui/2D/advancedDynamicTexture" {
772
772
  * @returns a new AdvancedDynamicTexture
773
773
  */
774
774
  static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number, adaptiveScaling?: boolean): AdvancedDynamicTexture;
775
+ /**
776
+ * Scales the texture
777
+ * @param ratio the scale factor to apply to both width and height
778
+ */
779
+ scale(ratio: number): void;
780
+ /**
781
+ * Resizes the texture
782
+ * @param width the new width
783
+ * @param height the new height
784
+ */
785
+ scaleTo(width: number, height: number): void;
775
786
  }
787
+ export { IFocusableControl };
776
788
  }
777
789
  declare module "babylonjs-gui/2D/controls/control" {
778
790
  import { Nullable } from "babylonjs/types";
@@ -1266,10 +1278,10 @@ declare module "babylonjs-gui/2D/controls/control" {
1266
1278
  /** Gets or sets if control is Enabled */
1267
1279
  get isEnabled(): boolean;
1268
1280
  set isEnabled(value: boolean);
1269
- /** Gets or sets background color of control if it's disabled */
1281
+ /** Gets or sets background color of control if it's disabled. Only applies to Button class. */
1270
1282
  get disabledColor(): string;
1271
1283
  set disabledColor(value: string);
1272
- /** Gets or sets front color of control if it's disabled */
1284
+ /** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */
1273
1285
  get disabledColorItem(): string;
1274
1286
  set disabledColorItem(value: string);
1275
1287
  /**
@@ -1298,6 +1310,15 @@ declare module "babylonjs-gui/2D/controls/control" {
1298
1310
  * @returns the ascendant or null if not found
1299
1311
  */
1300
1312
  getAscendantOfClass(className: string): Nullable<Control>;
1313
+ /**
1314
+ * Mark control element as dirty
1315
+ * @param force force non visible elements to be marked too
1316
+ */
1317
+ markAsDirty(force: false): void;
1318
+ /**
1319
+ * Mark the element and its children as dirty
1320
+ */
1321
+ markAllAsDirty(): void;
1301
1322
  /** @hidden */
1302
1323
  _resetFontCache(): void;
1303
1324
  /**
@@ -1380,7 +1401,7 @@ declare module "babylonjs-gui/2D/controls/control" {
1380
1401
  /** @hidden */
1381
1402
  _flagDescendantsAsMatrixDirty(): void;
1382
1403
  /** @hidden */
1383
- _intersectsRect(rect: Measure): boolean;
1404
+ _intersectsRect(rect: Measure, context?: ICanvasRenderingContext): boolean;
1384
1405
  /** @hidden */
1385
1406
  protected _computeAdditionnalOffsetX(): number;
1386
1407
  /** @hidden */
@@ -1833,6 +1854,7 @@ declare module "babylonjs-gui/2D/controls/textBlock" {
1833
1854
  protected _applyStates(context: ICanvasRenderingContext): void;
1834
1855
  protected _breakLines(refWidth: number, refHeight: number, context: ICanvasRenderingContext): object[];
1835
1856
  protected _parseLine(line: string | undefined, context: ICanvasRenderingContext): object;
1857
+ private _getCharsToRemove;
1836
1858
  protected _parseLineEllipsis(line: string | undefined, width: number, context: ICanvasRenderingContext): object;
1837
1859
  protected _parseLineWordWrap(line: string | undefined, width: number, context: ICanvasRenderingContext): object[];
1838
1860
  protected _parseLineWordWrapEllipsis(line: string | undefined, width: number, height: number, context: ICanvasRenderingContext): object[];
@@ -2396,6 +2418,8 @@ declare module "babylonjs-gui/2D/controls/inputText" {
2396
2418
  private _autoStretchWidth;
2397
2419
  private _maxWidth;
2398
2420
  private _isFocused;
2421
+ /** the type of device that most recently focused the input: "mouse", "touch" or "pen" */
2422
+ private _focusedBy;
2399
2423
  private _blinkTimeout;
2400
2424
  private _blinkIsEven;
2401
2425
  private _cursorOffset;
@@ -4348,6 +4372,7 @@ declare module "babylonjs-gui/3D/controls/touchButton3D" {
4348
4372
  import { Mesh } from "babylonjs/Meshes/mesh";
4349
4373
  import { TransformNode } from "babylonjs/Meshes/transformNode";
4350
4374
  import { Scene } from "babylonjs/scene";
4375
+ import { Observable } from "babylonjs/Misc/observable";
4351
4376
  import { Button3D } from "babylonjs-gui/3D/controls/button3D";
4352
4377
  /**
4353
4378
  * Class used to create a touchable button in 3D
@@ -4355,13 +4380,25 @@ declare module "babylonjs-gui/3D/controls/touchButton3D" {
4355
4380
  export class TouchButton3D extends Button3D {
4356
4381
  private _collisionMesh;
4357
4382
  private _collidableFrontDirection;
4358
- protected _isNearPressed: boolean;
4383
+ private _isNearPressed;
4384
+ private _interactionSurfaceHeight;
4385
+ private _isToggleButton;
4386
+ private _toggleState;
4387
+ private _toggleButtonCallback;
4388
+ /**
4389
+ * An event triggered when the button is toggled. Only fired if 'isToggleButton' is true
4390
+ */
4391
+ onToggleObservable: Observable<boolean>;
4359
4392
  /**
4360
4393
  * Creates a new touchable button
4361
4394
  * @param name defines the control name
4362
4395
  * @param collisionMesh mesh to track collisions with
4363
4396
  */
4364
4397
  constructor(name?: string, collisionMesh?: Mesh);
4398
+ /**
4399
+ * Whether the current interaction is caused by near interaction or not
4400
+ */
4401
+ get isActiveNearInteraction(): boolean;
4365
4402
  /**
4366
4403
  * Sets the front-facing direction of the button. Pass in Vector3.Zero to allow interactions from any direction
4367
4404
  * @param frontDir the forward direction of the button
@@ -4376,7 +4413,26 @@ declare module "babylonjs-gui/3D/controls/touchButton3D" {
4376
4413
  * @param collisionMesh the new collision mesh for the button
4377
4414
  */
4378
4415
  set collisionMesh(collisionMesh: Mesh);
4416
+ /**
4417
+ * Setter for if this TouchButton3D should be treated as a toggle button
4418
+ * @param value If this TouchHolographicButton should act like a toggle button
4419
+ */
4420
+ set isToggleButton(value: boolean);
4421
+ get isToggleButton(): boolean;
4422
+ /**
4423
+ * A public entrypoint to set the toggle state of the TouchHolographicButton. Only works if 'isToggleButton' is true
4424
+ * @param newState The new state to set the TouchHolographicButton's toggle state to
4425
+ */
4426
+ set isToggled(newState: boolean);
4427
+ get isToggled(): boolean;
4428
+ protected _onToggle(newState: boolean): void;
4379
4429
  private _isInteractionInFrontOfButton;
4430
+ /**
4431
+ * Get the height of the touchPoint from the collidable part of the button
4432
+ * @param touchPoint the point to compare to the button, in absolute position
4433
+ * @returns the depth of the touch point into the front of the button
4434
+ */
4435
+ getPressDepth(touchPoint: Vector3): number;
4380
4436
  protected _getInteractionHeight(interactionPos: Vector3, basePos: Vector3): number;
4381
4437
  /** @hidden */
4382
4438
  _generatePointerEventType(providedType: number, nearMeshPosition: Vector3, activeInteractionCount: number): number;
@@ -4768,7 +4824,7 @@ declare module "babylonjs-gui/3D/materials/fluent/fluentMaterial" {
4768
4824
  * @param name defines the name of the material
4769
4825
  * @param scene defines the hosting scene
4770
4826
  */
4771
- constructor(name: string, scene: Scene);
4827
+ constructor(name: string, scene?: Scene);
4772
4828
  needAlphaBlending(): boolean;
4773
4829
  needAlphaTesting(): boolean;
4774
4830
  getAlphaTestTexture(): Nullable<BaseTexture>;
@@ -5055,7 +5111,7 @@ declare module "babylonjs-gui/3D/materials/fluentButton/fluentButtonMaterial" {
5055
5111
  */
5056
5112
  globalRightIndexTipPosition: Vector3;
5057
5113
  private _blobTexture;
5058
- constructor(name: string, scene: Scene);
5114
+ constructor(name: string, scene?: Scene);
5059
5115
  needAlphaBlending(): boolean;
5060
5116
  needAlphaTesting(): boolean;
5061
5117
  getAlphaTestTexture(): Nullable<BaseTexture>;
@@ -5079,9 +5135,11 @@ declare module "babylonjs-gui/3D/controls/touchHolographicButton" {
5079
5135
  import { TransformNode } from "babylonjs/Meshes/transformNode";
5080
5136
  import { Mesh } from "babylonjs/Meshes/mesh";
5081
5137
  import { Scene } from "babylonjs/scene";
5138
+ import { FluentMaterial } from "babylonjs-gui/3D/materials/fluent/fluentMaterial";
5082
5139
  import { FluentButtonMaterial } from "babylonjs-gui/3D/materials/fluentButton/fluentButtonMaterial";
5083
5140
  import { AdvancedDynamicTexture } from "babylonjs-gui/2D/advancedDynamicTexture";
5084
5141
  import { TouchButton3D } from "babylonjs-gui/3D/controls/touchButton3D";
5142
+ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
5085
5143
  /**
5086
5144
  * Class used to create a holographic button in 3D
5087
5145
  * @since 5.0.0
@@ -5109,6 +5167,8 @@ declare module "babylonjs-gui/3D/controls/touchHolographicButton" {
5109
5167
  private _pointerHoverObserver;
5110
5168
  private _frontPlateDepth;
5111
5169
  private _backPlateDepth;
5170
+ private _backplateColor;
5171
+ private _backplateToggledColor;
5112
5172
  private _tooltipFade;
5113
5173
  private _tooltipTextBlock;
5114
5174
  private _tooltipTexture;
@@ -5121,6 +5181,10 @@ declare module "babylonjs-gui/3D/controls/touchHolographicButton" {
5121
5181
  */
5122
5182
  set renderingGroupId(id: number);
5123
5183
  get renderingGroupId(): number;
5184
+ /**
5185
+ * Gets the mesh used to render this control
5186
+ */
5187
+ get mesh(): Nullable<AbstractMesh>;
5124
5188
  /**
5125
5189
  * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)
5126
5190
  */
@@ -5139,7 +5203,7 @@ declare module "babylonjs-gui/3D/controls/touchHolographicButton" {
5139
5203
  /**
5140
5204
  * Gets the back material used by this button
5141
5205
  */
5142
- get backMaterial(): StandardMaterial;
5206
+ get backMaterial(): FluentMaterial;
5143
5207
  /**
5144
5208
  * Gets the front material used by this button
5145
5209
  */
@@ -5168,6 +5232,7 @@ declare module "babylonjs-gui/3D/controls/touchHolographicButton" {
5168
5232
  private _createBackMaterial;
5169
5233
  private _createFrontMaterial;
5170
5234
  private _createPlateMaterial;
5235
+ protected _onToggle(newState: boolean): void;
5171
5236
  protected _affectMaterial(mesh: Mesh): void;
5172
5237
  /**
5173
5238
  * Releases all associated resources
@@ -5175,6 +5240,81 @@ declare module "babylonjs-gui/3D/controls/touchHolographicButton" {
5175
5240
  dispose(): void;
5176
5241
  }
5177
5242
  }
5243
+ declare module "babylonjs-gui/3D/behaviors/defaultBehavior" {
5244
+ import { Behavior } from "babylonjs/Behaviors/behavior";
5245
+ import { FollowBehavior } from "babylonjs/Behaviors/Meshes/followBehavior";
5246
+ import { SixDofDragBehavior } from "babylonjs/Behaviors/Meshes/sixDofDragBehavior";
5247
+ import { Mesh } from "babylonjs/Meshes/mesh";
5248
+ import { Nullable } from "babylonjs/types";
5249
+ import { SurfaceMagnetismBehavior } from "babylonjs/Behaviors/Meshes/surfaceMagnetismBehavior";
5250
+ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
5251
+ /**
5252
+ * Default behavior for 3D UI elements.
5253
+ * Handles a FollowBehavior, SixDofBehavior and SurfaceMagnetismBehavior
5254
+ * @since 5.0.0
5255
+ */
5256
+ export class DefaultBehavior implements Behavior<Mesh> {
5257
+ private _scene;
5258
+ private _followBehavior;
5259
+ private _sixDofDragBehavior;
5260
+ private _surfaceMagnetismBehavior;
5261
+ private _onBeforeRenderObserver;
5262
+ private _onDragObserver;
5263
+ /**
5264
+ * Instantiates the default behavior
5265
+ */
5266
+ constructor();
5267
+ /**
5268
+ * Attached node of this behavior
5269
+ */
5270
+ attachedNode: Nullable<Mesh>;
5271
+ /**
5272
+ * The name of the behavior
5273
+ */
5274
+ get name(): string;
5275
+ /**
5276
+ * The follow behavior
5277
+ */
5278
+ get followBehavior(): FollowBehavior;
5279
+ /**
5280
+ * The six DoF drag behavior
5281
+ */
5282
+ get sixDofDragBehavior(): SixDofDragBehavior;
5283
+ /**
5284
+ * The surface magnetism behavior
5285
+ */
5286
+ get surfaceMagnetismBehavior(): SurfaceMagnetismBehavior;
5287
+ /**
5288
+ * Enables the follow behavior
5289
+ */
5290
+ followBehaviorEnabled: boolean;
5291
+ /**
5292
+ * Enables the six DoF drag behavior
5293
+ */
5294
+ sixDofDragBehaviorEnabled: boolean;
5295
+ /**
5296
+ * Enables the surface magnetism behavior
5297
+ */
5298
+ surfaceMagnetismBehaviorEnabled: boolean;
5299
+ /**
5300
+ * Initializes the behavior
5301
+ */
5302
+ init(): void;
5303
+ /**
5304
+ * Attaches the default behavior
5305
+ * @param ownerMesh The top level mesh
5306
+ * @param draggablesMeshes Descendant meshes that can be used for dragging the owner mesh
5307
+ * @param sceneUnderstandingMeshes Meshes from the scene understanding that will be used for surface magnetism
5308
+ */
5309
+ attach(ownerMesh: Mesh, draggablesMeshes?: Mesh[], sceneUnderstandingMeshes?: AbstractMesh[]): void;
5310
+ /**
5311
+ * Detaches the behavior from the mesh
5312
+ */
5313
+ detach(): void;
5314
+ private _addObservables;
5315
+ private _removeObservables;
5316
+ }
5317
+ }
5178
5318
  declare module "babylonjs-gui/3D/materials/handle/shaders/handle.vertex" {
5179
5319
  /** @hidden */
5180
5320
  export var handleVertexShader: {
@@ -5394,6 +5534,7 @@ declare module "babylonjs-gui/3D/gizmos/slateGizmo" {
5394
5534
  * Value we use to offset handles from mesh
5395
5535
  */
5396
5536
  private _margin;
5537
+ private _handleSize;
5397
5538
  private _attachedSlate;
5398
5539
  private _existingSlateScale;
5399
5540
  /**
@@ -5404,10 +5545,6 @@ declare module "babylonjs-gui/3D/gizmos/slateGizmo" {
5404
5545
  * The distance away from the object which the draggable meshes should appear world sized when fixedScreenSize is set to true (default: 10)
5405
5546
  */
5406
5547
  fixedScreenSizeDistanceFactor: number;
5407
- /**
5408
- * Size of the handles (meters in XR)
5409
- */
5410
- handleSize: number;
5411
5548
  /**
5412
5549
  * The slate attached to this gizmo
5413
5550
  */
@@ -5426,85 +5563,11 @@ declare module "babylonjs-gui/3D/gizmos/slateGizmo" {
5426
5563
  */
5427
5564
  updateBoundingBox(): void;
5428
5565
  private _updateHandlesPosition;
5566
+ private _updateHandlesScaling;
5429
5567
  protected _update(): void;
5430
5568
  dispose(): void;
5431
5569
  }
5432
5570
  }
5433
- declare module "babylonjs-gui/3D/behaviors/defaultBehavior" {
5434
- import { Behavior } from "babylonjs/Behaviors/behavior";
5435
- import { FollowBehavior } from "babylonjs/Behaviors/Meshes/followBehavior";
5436
- import { SixDofDragBehavior } from "babylonjs/Behaviors/Meshes/sixDofDragBehavior";
5437
- import { Mesh } from "babylonjs/Meshes/mesh";
5438
- import { Nullable } from "babylonjs/types";
5439
- import { SurfaceMagnetismBehavior } from "babylonjs/Behaviors/Meshes/surfaceMagnetismBehavior";
5440
- import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
5441
- /**
5442
- * Default behavior for 3D UI elements.
5443
- * Handles a FollowBehavior, SixDofBehavior and SurfaceMagnetismBehavior
5444
- * @since 5.0.0
5445
- */
5446
- export class DefaultBehavior implements Behavior<Mesh> {
5447
- private _scene;
5448
- private _followBehavior;
5449
- private _sixDofDragBehavior;
5450
- private _surfaceMagnetismBehavior;
5451
- private _onBeforeRenderObserver;
5452
- private _onDragObserver;
5453
- /**
5454
- * Instantiates the default behavior
5455
- */
5456
- constructor();
5457
- /**
5458
- * Attached node of this behavior
5459
- */
5460
- attachedNode: Nullable<Mesh>;
5461
- /**
5462
- * The name of the behavior
5463
- */
5464
- get name(): string;
5465
- /**
5466
- * The follow behavior
5467
- */
5468
- get followBehavior(): FollowBehavior;
5469
- /**
5470
- * The six DoF drag behavior
5471
- */
5472
- get sixDofDragBehavior(): SixDofDragBehavior;
5473
- /**
5474
- * The surface magnetism behavior
5475
- */
5476
- get surfaceMagnetismBehavior(): SurfaceMagnetismBehavior;
5477
- /**
5478
- * Enables the follow behavior
5479
- */
5480
- followBehaviorEnabled: boolean;
5481
- /**
5482
- * Enables the six DoF drag behavior
5483
- */
5484
- sixDofDragBehaviorEnabled: boolean;
5485
- /**
5486
- * Enables the surface magnetism behavior
5487
- */
5488
- surfaceMagnetismBehaviorEnabled: boolean;
5489
- /**
5490
- * Initializes the behavior
5491
- */
5492
- init(): void;
5493
- /**
5494
- * Attaches the default behavior
5495
- * @param ownerMesh The top level mesh
5496
- * @param draggablesMeshes Descendant meshes that can be used for dragging the owner mesh
5497
- * @param sceneUnderstandingMeshes Meshes from the scene understanding that will be used for surface magnetism
5498
- */
5499
- attach(ownerMesh: Mesh, draggablesMeshes?: Mesh[], sceneUnderstandingMeshes?: AbstractMesh[]): void;
5500
- /**
5501
- * Detaches the behavior from the mesh
5502
- */
5503
- detach(): void;
5504
- private _addObservables;
5505
- private _removeObservables;
5506
- }
5507
- }
5508
5571
  declare module "babylonjs-gui/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment" {
5509
5572
  /** @hidden */
5510
5573
  export var fluentBackplatePixelShader: {
@@ -5657,7 +5720,7 @@ declare module "babylonjs-gui/3D/materials/fluentBackplate/fluentBackplateMateri
5657
5720
  */
5658
5721
  globalRightIndexTipPosition: Vector3;
5659
5722
  private _globalRightIndexTipPosition4;
5660
- constructor(name: string, scene: Scene);
5723
+ constructor(name: string, scene?: Scene);
5661
5724
  needAlphaBlending(): boolean;
5662
5725
  needAlphaTesting(): boolean;
5663
5726
  getAlphaTestTexture(): Nullable<BaseTexture>;
@@ -5676,16 +5739,16 @@ declare module "babylonjs-gui/3D/materials/fluentBackplate/fluentBackplateMateri
5676
5739
  }
5677
5740
  }
5678
5741
  declare module "babylonjs-gui/3D/controls/holographicSlate" {
5679
- import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
5680
- import { Scene } from "babylonjs/scene";
5681
- import { TransformNode } from "babylonjs/Meshes/transformNode";
5682
- import { Mesh } from "babylonjs/Meshes/mesh";
5683
- import { TouchHolographicButton } from "babylonjs-gui/3D/controls/touchHolographicButton";
5684
- import { Vector3 } from "babylonjs/Maths/math.vector";
5685
5742
  import { ContentDisplay3D } from "babylonjs-gui/3D/controls/contentDisplay3D";
5743
+ import { TouchHolographicButton } from "babylonjs-gui/3D/controls/touchHolographicButton";
5686
5744
  import { AdvancedDynamicTexture } from "babylonjs-gui/2D/advancedDynamicTexture";
5687
- import { SlateGizmo } from "babylonjs-gui/3D/gizmos/slateGizmo";
5688
5745
  import { DefaultBehavior } from "babylonjs-gui/3D/behaviors/defaultBehavior";
5746
+ import { SlateGizmo } from "babylonjs-gui/3D/gizmos/slateGizmo";
5747
+ import { Vector2, Vector3 } from "babylonjs/Maths/math.vector";
5748
+ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
5749
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
5750
+ import { Mesh } from "babylonjs/Meshes/mesh";
5751
+ import { Scene } from "babylonjs/scene";
5689
5752
  /**
5690
5753
  * Class used to create a holographic slate
5691
5754
  * @since 5.0.0
@@ -5703,35 +5766,24 @@ declare module "babylonjs-gui/3D/controls/holographicSlate" {
5703
5766
  * File name for the close icon.
5704
5767
  */
5705
5768
  static FOLLOW_ICON_FILENAME: string;
5769
+ private static DEFAULT_TEXT_RESOLUTION_Y;
5706
5770
  /**
5707
- * Dimensions of the slate
5708
- */
5709
- dimensions: Vector3;
5710
- /**
5711
- * Minimum dimensions of the slate
5712
- */
5713
- minDimensions: Vector3;
5714
- /**
5715
- * Default dimensions of the slate
5771
+ * Margin between title bar and contentplate
5716
5772
  */
5717
- readonly defaultDimensions: Vector3;
5718
- /**
5719
- * Dimensions of the backplate
5720
- */
5721
- backplateDimensions: Vector3;
5722
- /**
5723
- * Margin between backplate and contentplate
5724
- */
5725
- backPlateMargin: number;
5773
+ titleBarMargin: number;
5726
5774
  /**
5727
5775
  * Origin in local coordinates (top left corner)
5728
5776
  */
5729
5777
  origin: Vector3;
5730
- private _backPlateMaterial;
5778
+ private _dimensions;
5779
+ private _titleBarHeight;
5780
+ private _titleBarMaterial;
5781
+ private _backMaterial;
5731
5782
  private _contentMaterial;
5732
5783
  private _pickedPointObserver;
5733
5784
  private _positionChangedObserver;
5734
- private _imageUrl;
5785
+ private _titleText;
5786
+ private _titleTextComponent;
5735
5787
  private _contentViewport;
5736
5788
  private _contentDragBehavior;
5737
5789
  private _defaultBehavior;
@@ -5741,21 +5793,42 @@ declare module "babylonjs-gui/3D/controls/holographicSlate" {
5741
5793
  get defaultBehavior(): DefaultBehavior;
5742
5794
  /** @hidden */
5743
5795
  _gizmo: SlateGizmo;
5744
- protected _backPlate: Mesh;
5796
+ protected _titleBar: Mesh;
5797
+ protected _titleBarTitle: Mesh;
5745
5798
  protected _contentPlate: Mesh;
5746
- protected _followButton: TouchHolographicButton;
5799
+ protected _backPlate: Mesh;
5800
+ /** @hidden */
5801
+ _followButton: TouchHolographicButton;
5747
5802
  protected _closeButton: TouchHolographicButton;
5748
5803
  protected _contentScaleRatio: number;
5749
5804
  /**
5750
- * Rendering ground id of all the mesh in the button
5805
+ * 2D dimensions of the slate
5806
+ */
5807
+ get dimensions(): Vector2;
5808
+ set dimensions(value: Vector2);
5809
+ /**
5810
+ * Minimum dimensions of the slate
5811
+ */
5812
+ minDimensions: Vector2;
5813
+ /**
5814
+ * Default dimensions of the slate
5815
+ */
5816
+ readonly defaultDimensions: Vector2;
5817
+ /**
5818
+ * Height of the title bar component
5819
+ */
5820
+ get titleBarHeight(): number;
5821
+ set titleBarHeight(value: number);
5822
+ /**
5823
+ * Rendering ground id of all the meshes
5751
5824
  */
5752
5825
  set renderingGroupId(id: number);
5753
5826
  get renderingGroupId(): number;
5754
5827
  /**
5755
- * Gets or sets the image url for the button
5828
+ * The title text displayed at the top of the slate
5756
5829
  */
5757
- get imageUrl(): string;
5758
- set imageUrl(value: string);
5830
+ set title(title: string);
5831
+ get title(): string;
5759
5832
  /**
5760
5833
  * Creates a new slate
5761
5834
  * @param name defines the control name
@@ -5767,7 +5840,6 @@ declare module "babylonjs-gui/3D/controls/holographicSlate" {
5767
5840
  * @param facadeTexture defines the AdvancedDynamicTexture to use
5768
5841
  */
5769
5842
  protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
5770
- private _rebuildContent;
5771
5843
  private _addControl;
5772
5844
  protected _getTypeName(): string;
5773
5845
  /**
@@ -5787,8 +5859,9 @@ declare module "babylonjs-gui/3D/controls/holographicSlate" {
5787
5859
  _prepareNode(scene: Scene): void;
5788
5860
  /**
5789
5861
  * Resets the aspect and pose of the slate so it is right in front of the active camera, facing towards it.
5862
+ * @param resetAspect Should the slate's dimensions/aspect ratio be reset as well
5790
5863
  */
5791
- resetDefaultAspectAndPose(): void;
5864
+ resetDefaultAspectAndPose(resetAspect?: boolean): void;
5792
5865
  /**
5793
5866
  * Releases all associated resources
5794
5867
  */
@@ -5931,7 +6004,6 @@ declare module "babylonjs-gui/3D/controls/nearMenu" {
5931
6004
  */
5932
6005
  private static PIN_ICON_FILENAME;
5933
6006
  private _pinButton;
5934
- private _pinMaterial;
5935
6007
  private _dragObserver;
5936
6008
  private _defaultBehavior;
5937
6009
  /**
@@ -6320,7 +6392,7 @@ declare module "babylonjs-gui/3D/materials/mrdl/mrdlSliderBarMaterial" {
6320
6392
  * @hidden
6321
6393
  */
6322
6394
  globalRightIndexMiddlePosition: Vector4;
6323
- constructor(name: string, scene: Scene);
6395
+ constructor(name: string, scene?: Scene);
6324
6396
  needAlphaBlending(): boolean;
6325
6397
  needAlphaTesting(): boolean;
6326
6398
  getAlphaTestTexture(): Nullable<BaseTexture>;
@@ -6669,7 +6741,7 @@ declare module "babylonjs-gui/3D/materials/mrdl/mrdlSliderThumbMaterial" {
6669
6741
  * @hidden
6670
6742
  */
6671
6743
  globalRightIndexMiddlePosition: Vector4;
6672
- constructor(name: string, scene: Scene);
6744
+ constructor(name: string, scene?: Scene);
6673
6745
  needAlphaBlending(): boolean;
6674
6746
  needAlphaTesting(): boolean;
6675
6747
  getAlphaTestTexture(): Nullable<BaseTexture>;
@@ -6832,7 +6904,7 @@ declare module "babylonjs-gui/3D/materials/mrdl/mrdlBackplateMaterial" {
6832
6904
  * Gets or sets the edge width of the backplate.
6833
6905
  */
6834
6906
  edgeLineGradientBlend: number;
6835
- constructor(name: string, scene: Scene);
6907
+ constructor(name: string, scene?: Scene);
6836
6908
  needAlphaBlending(): boolean;
6837
6909
  needAlphaTesting(): boolean;
6838
6910
  getAlphaTestTexture(): Nullable<BaseTexture>;
@@ -6999,43 +7071,6 @@ declare module "babylonjs-gui/3D/controls/touchMeshButton3D" {
6999
7071
  protected _affectMaterial(mesh: AbstractMesh): void;
7000
7072
  }
7001
7073
  }
7002
- declare module "babylonjs-gui/3D/controls/touchToggleButton3D" {
7003
- import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
7004
- import { Mesh } from "babylonjs/Meshes/mesh";
7005
- import { Observable } from "babylonjs/Misc/observable";
7006
- import { Scene } from "babylonjs/scene";
7007
- import { TransformNode } from "babylonjs/Meshes/transformNode";
7008
- import { Vector3 } from "babylonjs/Maths/math.vector";
7009
- import { TouchButton3D } from "babylonjs-gui/3D/controls/touchButton3D";
7010
- /**
7011
- * Class used as base class for touch-enabled toggleable buttons
7012
- */
7013
- export class TouchToggleButton3D extends TouchButton3D {
7014
- private _isPressed;
7015
- /**
7016
- * An event triggered when the button is toggled on
7017
- */
7018
- onToggleOnObservable: Observable<Vector3>;
7019
- /**
7020
- * An event triggered when the button is toggled off
7021
- */
7022
- onToggleOffObservable: Observable<Vector3>;
7023
- /**
7024
- * Creates a new button
7025
- * @param name defines the control name
7026
- * @param collisionMesh defines the mesh to track near interactions with
7027
- */
7028
- constructor(name?: string, collisionMesh?: Mesh);
7029
- private _onToggle;
7030
- protected _getTypeName(): string;
7031
- protected _createNode(scene: Scene): TransformNode;
7032
- protected _affectMaterial(mesh: AbstractMesh): void;
7033
- /**
7034
- * Releases all associated resources
7035
- */
7036
- dispose(): void;
7037
- }
7038
- }
7039
7074
  declare module "babylonjs-gui/3D/controls/holographicBackplate" {
7040
7075
  import { TransformNode } from "babylonjs/Meshes/transformNode";
7041
7076
  import { Mesh } from "babylonjs/Meshes/mesh";
@@ -7106,7 +7141,6 @@ declare module "babylonjs-gui/3D/controls/index" {
7106
7141
  export * from "babylonjs-gui/3D/controls/touchMeshButton3D";
7107
7142
  export * from "babylonjs-gui/3D/controls/touchHolographicButton";
7108
7143
  export * from "babylonjs-gui/3D/controls/touchHolographicMenu";
7109
- export * from "babylonjs-gui/3D/controls/touchToggleButton3D";
7110
7144
  export * from "babylonjs-gui/3D/controls/volumeBasedPanel";
7111
7145
  export * from "babylonjs-gui/3D/controls/holographicBackplate";
7112
7146
  }
@@ -7721,7 +7755,7 @@ declare module BABYLON.GUI {
7721
7755
  * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
7722
7756
  * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
7723
7757
  */
7724
- constructor(name: string, width: number | undefined, height: number | undefined, scene: BABYLON.Nullable<BABYLON.Scene>, generateMipMaps?: boolean, samplingMode?: number, invertY?: boolean);
7758
+ constructor(name: string, width?: number, height?: number, scene?: BABYLON.Nullable<BABYLON.Scene>, generateMipMaps?: boolean, samplingMode?: number, invertY?: boolean);
7725
7759
  /**
7726
7760
  * Get the current class name of the texture useful for serialization or dynamic coding.
7727
7761
  * @returns "AdvancedDynamicTexture"
@@ -7910,6 +7944,17 @@ declare module BABYLON.GUI {
7910
7944
  * @returns a new AdvancedDynamicTexture
7911
7945
  */
7912
7946
  static CreateFullscreenUI(name: string, foreground?: boolean, scene?: BABYLON.Nullable<BABYLON.Scene>, sampling?: number, adaptiveScaling?: boolean): AdvancedDynamicTexture;
7947
+ /**
7948
+ * Scales the texture
7949
+ * @param ratio the scale factor to apply to both width and height
7950
+ */
7951
+ scale(ratio: number): void;
7952
+ /**
7953
+ * Resizes the texture
7954
+ * @param width the new width
7955
+ * @param height the new height
7956
+ */
7957
+ scaleTo(width: number, height: number): void;
7913
7958
  }
7914
7959
  }
7915
7960
  declare module BABYLON.GUI {
@@ -8391,10 +8436,10 @@ declare module BABYLON.GUI {
8391
8436
  /** Gets or sets if control is Enabled */
8392
8437
  get isEnabled(): boolean;
8393
8438
  set isEnabled(value: boolean);
8394
- /** Gets or sets background color of control if it's disabled */
8439
+ /** Gets or sets background color of control if it's disabled. Only applies to Button class. */
8395
8440
  get disabledColor(): string;
8396
8441
  set disabledColor(value: string);
8397
- /** Gets or sets front color of control if it's disabled */
8442
+ /** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */
8398
8443
  get disabledColorItem(): string;
8399
8444
  set disabledColorItem(value: string);
8400
8445
  /**
@@ -8423,6 +8468,15 @@ declare module BABYLON.GUI {
8423
8468
  * @returns the ascendant or null if not found
8424
8469
  */
8425
8470
  getAscendantOfClass(className: string): BABYLON.Nullable<Control>;
8471
+ /**
8472
+ * Mark control element as dirty
8473
+ * @param force force non visible elements to be marked too
8474
+ */
8475
+ markAsDirty(force: false): void;
8476
+ /**
8477
+ * Mark the element and its children as dirty
8478
+ */
8479
+ markAllAsDirty(): void;
8426
8480
  /** @hidden */
8427
8481
  _resetFontCache(): void;
8428
8482
  /**
@@ -8505,7 +8559,7 @@ declare module BABYLON.GUI {
8505
8559
  /** @hidden */
8506
8560
  _flagDescendantsAsMatrixDirty(): void;
8507
8561
  /** @hidden */
8508
- _intersectsRect(rect: Measure): boolean;
8562
+ _intersectsRect(rect: Measure, context?: BABYLON.ICanvasRenderingContext): boolean;
8509
8563
  /** @hidden */
8510
8564
  protected _computeAdditionnalOffsetX(): number;
8511
8565
  /** @hidden */
@@ -8943,6 +8997,7 @@ declare module BABYLON.GUI {
8943
8997
  protected _applyStates(context: BABYLON.ICanvasRenderingContext): void;
8944
8998
  protected _breakLines(refWidth: number, refHeight: number, context: BABYLON.ICanvasRenderingContext): object[];
8945
8999
  protected _parseLine(line: string | undefined, context: BABYLON.ICanvasRenderingContext): object;
9000
+ private _getCharsToRemove;
8946
9001
  protected _parseLineEllipsis(line: string | undefined, width: number, context: BABYLON.ICanvasRenderingContext): object;
8947
9002
  protected _parseLineWordWrap(line: string | undefined, width: number, context: BABYLON.ICanvasRenderingContext): object[];
8948
9003
  protected _parseLineWordWrapEllipsis(line: string | undefined, width: number, height: number, context: BABYLON.ICanvasRenderingContext): object[];
@@ -9466,6 +9521,8 @@ declare module BABYLON.GUI {
9466
9521
  private _autoStretchWidth;
9467
9522
  private _maxWidth;
9468
9523
  private _isFocused;
9524
+ /** the type of device that most recently focused the input: "mouse", "touch" or "pen" */
9525
+ private _focusedBy;
9469
9526
  private _blinkTimeout;
9470
9527
  private _blinkIsEven;
9471
9528
  private _cursorOffset;
@@ -11253,13 +11310,25 @@ declare module BABYLON.GUI {
11253
11310
  export class TouchButton3D extends Button3D {
11254
11311
  private _collisionMesh;
11255
11312
  private _collidableFrontDirection;
11256
- protected _isNearPressed: boolean;
11313
+ private _isNearPressed;
11314
+ private _interactionSurfaceHeight;
11315
+ private _isToggleButton;
11316
+ private _toggleState;
11317
+ private _toggleButtonCallback;
11318
+ /**
11319
+ * An event triggered when the button is toggled. Only fired if 'isToggleButton' is true
11320
+ */
11321
+ onToggleObservable: BABYLON.Observable<boolean>;
11257
11322
  /**
11258
11323
  * Creates a new touchable button
11259
11324
  * @param name defines the control name
11260
11325
  * @param collisionMesh mesh to track collisions with
11261
11326
  */
11262
11327
  constructor(name?: string, collisionMesh?: BABYLON.Mesh);
11328
+ /**
11329
+ * Whether the current interaction is caused by near interaction or not
11330
+ */
11331
+ get isActiveNearInteraction(): boolean;
11263
11332
  /**
11264
11333
  * Sets the front-facing direction of the button. Pass in BABYLON.Vector3.Zero to allow interactions from any direction
11265
11334
  * @param frontDir the forward direction of the button
@@ -11274,7 +11343,26 @@ declare module BABYLON.GUI {
11274
11343
  * @param collisionMesh the new collision mesh for the button
11275
11344
  */
11276
11345
  set collisionMesh(collisionMesh: BABYLON.Mesh);
11346
+ /**
11347
+ * Setter for if this TouchButton3D should be treated as a toggle button
11348
+ * @param value If this TouchHolographicButton should act like a toggle button
11349
+ */
11350
+ set isToggleButton(value: boolean);
11351
+ get isToggleButton(): boolean;
11352
+ /**
11353
+ * A public entrypoint to set the toggle state of the TouchHolographicButton. Only works if 'isToggleButton' is true
11354
+ * @param newState The new state to set the TouchHolographicButton's toggle state to
11355
+ */
11356
+ set isToggled(newState: boolean);
11357
+ get isToggled(): boolean;
11358
+ protected _onToggle(newState: boolean): void;
11277
11359
  private _isInteractionInFrontOfButton;
11360
+ /**
11361
+ * Get the height of the touchPoint from the collidable part of the button
11362
+ * @param touchPoint the point to compare to the button, in absolute position
11363
+ * @returns the depth of the touch point into the front of the button
11364
+ */
11365
+ getPressDepth(touchPoint: BABYLON.Vector3): number;
11278
11366
  protected _getInteractionHeight(interactionPos: BABYLON.Vector3, basePos: BABYLON.Vector3): number;
11279
11367
  /** @hidden */
11280
11368
  _generatePointerEventType(providedType: number, nearMeshPosition: BABYLON.Vector3, activeInteractionCount: number): number;
@@ -11630,7 +11718,7 @@ declare module BABYLON.GUI {
11630
11718
  * @param name defines the name of the material
11631
11719
  * @param scene defines the hosting scene
11632
11720
  */
11633
- constructor(name: string, scene: BABYLON.Scene);
11721
+ constructor(name: string, scene?: BABYLON.Scene);
11634
11722
  needAlphaBlending(): boolean;
11635
11723
  needAlphaTesting(): boolean;
11636
11724
  getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
@@ -11897,7 +11985,7 @@ declare module BABYLON.GUI {
11897
11985
  */
11898
11986
  globalRightIndexTipPosition: BABYLON.Vector3;
11899
11987
  private _blobTexture;
11900
- constructor(name: string, scene: BABYLON.Scene);
11988
+ constructor(name: string, scene?: BABYLON.Scene);
11901
11989
  needAlphaBlending(): boolean;
11902
11990
  needAlphaTesting(): boolean;
11903
11991
  getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
@@ -11943,6 +12031,8 @@ declare module BABYLON.GUI {
11943
12031
  private _pointerHoverObserver;
11944
12032
  private _frontPlateDepth;
11945
12033
  private _backPlateDepth;
12034
+ private _backplateColor;
12035
+ private _backplateToggledColor;
11946
12036
  private _tooltipFade;
11947
12037
  private _tooltipTextBlock;
11948
12038
  private _tooltipTexture;
@@ -11955,6 +12045,10 @@ declare module BABYLON.GUI {
11955
12045
  */
11956
12046
  set renderingGroupId(id: number);
11957
12047
  get renderingGroupId(): number;
12048
+ /**
12049
+ * Gets the mesh used to render this control
12050
+ */
12051
+ get mesh(): BABYLON.Nullable<BABYLON.AbstractMesh>;
11958
12052
  /**
11959
12053
  * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)
11960
12054
  */
@@ -11973,7 +12067,7 @@ declare module BABYLON.GUI {
11973
12067
  /**
11974
12068
  * Gets the back material used by this button
11975
12069
  */
11976
- get backMaterial(): BABYLON.StandardMaterial;
12070
+ get backMaterial(): FluentMaterial;
11977
12071
  /**
11978
12072
  * Gets the front material used by this button
11979
12073
  */
@@ -12002,6 +12096,7 @@ declare module BABYLON.GUI {
12002
12096
  private _createBackMaterial;
12003
12097
  private _createFrontMaterial;
12004
12098
  private _createPlateMaterial;
12099
+ protected _onToggle(newState: boolean): void;
12005
12100
  protected _affectMaterial(mesh: BABYLON.Mesh): void;
12006
12101
  /**
12007
12102
  * Releases all associated resources
@@ -12009,6 +12104,74 @@ declare module BABYLON.GUI {
12009
12104
  dispose(): void;
12010
12105
  }
12011
12106
  }
12107
+ declare module BABYLON.GUI {
12108
+ /**
12109
+ * Default behavior for 3D UI elements.
12110
+ * Handles a BABYLON.FollowBehavior, SixDofBehavior and BABYLON.SurfaceMagnetismBehavior
12111
+ * @since 5.0.0
12112
+ */
12113
+ export class DefaultBehavior implements BABYLON.Behavior<BABYLON.Mesh> {
12114
+ private _scene;
12115
+ private _followBehavior;
12116
+ private _sixDofDragBehavior;
12117
+ private _surfaceMagnetismBehavior;
12118
+ private _onBeforeRenderObserver;
12119
+ private _onDragObserver;
12120
+ /**
12121
+ * Instantiates the default behavior
12122
+ */
12123
+ constructor();
12124
+ /**
12125
+ * Attached node of this behavior
12126
+ */
12127
+ attachedNode: BABYLON.Nullable<BABYLON.Mesh>;
12128
+ /**
12129
+ * The name of the behavior
12130
+ */
12131
+ get name(): string;
12132
+ /**
12133
+ * The follow behavior
12134
+ */
12135
+ get followBehavior(): BABYLON.FollowBehavior;
12136
+ /**
12137
+ * The six DoF drag behavior
12138
+ */
12139
+ get sixDofDragBehavior(): BABYLON.SixDofDragBehavior;
12140
+ /**
12141
+ * The surface magnetism behavior
12142
+ */
12143
+ get surfaceMagnetismBehavior(): BABYLON.SurfaceMagnetismBehavior;
12144
+ /**
12145
+ * Enables the follow behavior
12146
+ */
12147
+ followBehaviorEnabled: boolean;
12148
+ /**
12149
+ * Enables the six DoF drag behavior
12150
+ */
12151
+ sixDofDragBehaviorEnabled: boolean;
12152
+ /**
12153
+ * Enables the surface magnetism behavior
12154
+ */
12155
+ surfaceMagnetismBehaviorEnabled: boolean;
12156
+ /**
12157
+ * Initializes the behavior
12158
+ */
12159
+ init(): void;
12160
+ /**
12161
+ * Attaches the default behavior
12162
+ * @param ownerMesh The top level mesh
12163
+ * @param draggablesMeshes Descendant meshes that can be used for dragging the owner mesh
12164
+ * @param sceneUnderstandingMeshes Meshes from the scene understanding that will be used for surface magnetism
12165
+ */
12166
+ attach(ownerMesh: BABYLON.Mesh, draggablesMeshes?: BABYLON.Mesh[], sceneUnderstandingMeshes?: BABYLON.AbstractMesh[]): void;
12167
+ /**
12168
+ * Detaches the behavior from the mesh
12169
+ */
12170
+ detach(): void;
12171
+ private _addObservables;
12172
+ private _removeObservables;
12173
+ }
12174
+ }
12012
12175
  declare module BABYLON.GUI {
12013
12176
  /** @hidden */
12014
12177
  export var handleVertexShader: {
@@ -12211,6 +12374,7 @@ declare module BABYLON.GUI {
12211
12374
  * Value we use to offset handles from mesh
12212
12375
  */
12213
12376
  private _margin;
12377
+ private _handleSize;
12214
12378
  private _attachedSlate;
12215
12379
  private _existingSlateScale;
12216
12380
  /**
@@ -12221,10 +12385,6 @@ declare module BABYLON.GUI {
12221
12385
  * The distance away from the object which the draggable meshes should appear world sized when fixedScreenSize is set to true (default: 10)
12222
12386
  */
12223
12387
  fixedScreenSizeDistanceFactor: number;
12224
- /**
12225
- * Size of the handles (meters in XR)
12226
- */
12227
- handleSize: number;
12228
12388
  /**
12229
12389
  * The slate attached to this gizmo
12230
12390
  */
@@ -12243,78 +12403,11 @@ declare module BABYLON.GUI {
12243
12403
  */
12244
12404
  updateBoundingBox(): void;
12245
12405
  private _updateHandlesPosition;
12406
+ private _updateHandlesScaling;
12246
12407
  protected _update(): void;
12247
12408
  dispose(): void;
12248
12409
  }
12249
12410
  }
12250
- declare module BABYLON.GUI {
12251
- /**
12252
- * Default behavior for 3D UI elements.
12253
- * Handles a BABYLON.FollowBehavior, SixDofBehavior and BABYLON.SurfaceMagnetismBehavior
12254
- * @since 5.0.0
12255
- */
12256
- export class DefaultBehavior implements BABYLON.Behavior<BABYLON.Mesh> {
12257
- private _scene;
12258
- private _followBehavior;
12259
- private _sixDofDragBehavior;
12260
- private _surfaceMagnetismBehavior;
12261
- private _onBeforeRenderObserver;
12262
- private _onDragObserver;
12263
- /**
12264
- * Instantiates the default behavior
12265
- */
12266
- constructor();
12267
- /**
12268
- * Attached node of this behavior
12269
- */
12270
- attachedNode: BABYLON.Nullable<BABYLON.Mesh>;
12271
- /**
12272
- * The name of the behavior
12273
- */
12274
- get name(): string;
12275
- /**
12276
- * The follow behavior
12277
- */
12278
- get followBehavior(): BABYLON.FollowBehavior;
12279
- /**
12280
- * The six DoF drag behavior
12281
- */
12282
- get sixDofDragBehavior(): BABYLON.SixDofDragBehavior;
12283
- /**
12284
- * The surface magnetism behavior
12285
- */
12286
- get surfaceMagnetismBehavior(): BABYLON.SurfaceMagnetismBehavior;
12287
- /**
12288
- * Enables the follow behavior
12289
- */
12290
- followBehaviorEnabled: boolean;
12291
- /**
12292
- * Enables the six DoF drag behavior
12293
- */
12294
- sixDofDragBehaviorEnabled: boolean;
12295
- /**
12296
- * Enables the surface magnetism behavior
12297
- */
12298
- surfaceMagnetismBehaviorEnabled: boolean;
12299
- /**
12300
- * Initializes the behavior
12301
- */
12302
- init(): void;
12303
- /**
12304
- * Attaches the default behavior
12305
- * @param ownerMesh The top level mesh
12306
- * @param draggablesMeshes Descendant meshes that can be used for dragging the owner mesh
12307
- * @param sceneUnderstandingMeshes Meshes from the scene understanding that will be used for surface magnetism
12308
- */
12309
- attach(ownerMesh: BABYLON.Mesh, draggablesMeshes?: BABYLON.Mesh[], sceneUnderstandingMeshes?: BABYLON.AbstractMesh[]): void;
12310
- /**
12311
- * Detaches the behavior from the mesh
12312
- */
12313
- detach(): void;
12314
- private _addObservables;
12315
- private _removeObservables;
12316
- }
12317
- }
12318
12411
  declare module BABYLON.GUI {
12319
12412
  /** @hidden */
12320
12413
  export var fluentBackplatePixelShader: {
@@ -12455,7 +12548,7 @@ declare module BABYLON.GUI {
12455
12548
  */
12456
12549
  globalRightIndexTipPosition: BABYLON.Vector3;
12457
12550
  private _globalRightIndexTipPosition4;
12458
- constructor(name: string, scene: BABYLON.Scene);
12551
+ constructor(name: string, scene?: BABYLON.Scene);
12459
12552
  needAlphaBlending(): boolean;
12460
12553
  needAlphaTesting(): boolean;
12461
12554
  getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
@@ -12491,35 +12584,24 @@ declare module BABYLON.GUI {
12491
12584
  * File name for the close icon.
12492
12585
  */
12493
12586
  static FOLLOW_ICON_FILENAME: string;
12587
+ private static DEFAULT_TEXT_RESOLUTION_Y;
12494
12588
  /**
12495
- * Dimensions of the slate
12589
+ * Margin between title bar and contentplate
12496
12590
  */
12497
- dimensions: BABYLON.Vector3;
12498
- /**
12499
- * Minimum dimensions of the slate
12500
- */
12501
- minDimensions: BABYLON.Vector3;
12502
- /**
12503
- * Default dimensions of the slate
12504
- */
12505
- readonly defaultDimensions: BABYLON.Vector3;
12506
- /**
12507
- * Dimensions of the backplate
12508
- */
12509
- backplateDimensions: BABYLON.Vector3;
12510
- /**
12511
- * Margin between backplate and contentplate
12512
- */
12513
- backPlateMargin: number;
12591
+ titleBarMargin: number;
12514
12592
  /**
12515
12593
  * Origin in local coordinates (top left corner)
12516
12594
  */
12517
12595
  origin: BABYLON.Vector3;
12518
- private _backPlateMaterial;
12596
+ private _dimensions;
12597
+ private _titleBarHeight;
12598
+ private _titleBarMaterial;
12599
+ private _backMaterial;
12519
12600
  private _contentMaterial;
12520
12601
  private _pickedPointObserver;
12521
12602
  private _positionChangedObserver;
12522
- private _imageUrl;
12603
+ private _titleText;
12604
+ private _titleTextComponent;
12523
12605
  private _contentViewport;
12524
12606
  private _contentDragBehavior;
12525
12607
  private _defaultBehavior;
@@ -12529,21 +12611,42 @@ declare module BABYLON.GUI {
12529
12611
  get defaultBehavior(): DefaultBehavior;
12530
12612
  /** @hidden */
12531
12613
  _gizmo: SlateGizmo;
12532
- protected _backPlate: BABYLON.Mesh;
12614
+ protected _titleBar: BABYLON.Mesh;
12615
+ protected _titleBarTitle: BABYLON.Mesh;
12533
12616
  protected _contentPlate: BABYLON.Mesh;
12534
- protected _followButton: TouchHolographicButton;
12617
+ protected _backPlate: BABYLON.Mesh;
12618
+ /** @hidden */
12619
+ _followButton: TouchHolographicButton;
12535
12620
  protected _closeButton: TouchHolographicButton;
12536
12621
  protected _contentScaleRatio: number;
12537
12622
  /**
12538
- * Rendering ground id of all the mesh in the button
12623
+ * 2D dimensions of the slate
12624
+ */
12625
+ get dimensions(): BABYLON.Vector2;
12626
+ set dimensions(value: BABYLON.Vector2);
12627
+ /**
12628
+ * Minimum dimensions of the slate
12629
+ */
12630
+ minDimensions: BABYLON.Vector2;
12631
+ /**
12632
+ * Default dimensions of the slate
12633
+ */
12634
+ readonly defaultDimensions: BABYLON.Vector2;
12635
+ /**
12636
+ * Height of the title bar component
12637
+ */
12638
+ get titleBarHeight(): number;
12639
+ set titleBarHeight(value: number);
12640
+ /**
12641
+ * Rendering ground id of all the meshes
12539
12642
  */
12540
12643
  set renderingGroupId(id: number);
12541
12644
  get renderingGroupId(): number;
12542
12645
  /**
12543
- * Gets or sets the image url for the button
12646
+ * The title text displayed at the top of the slate
12544
12647
  */
12545
- get imageUrl(): string;
12546
- set imageUrl(value: string);
12648
+ set title(title: string);
12649
+ get title(): string;
12547
12650
  /**
12548
12651
  * Creates a new slate
12549
12652
  * @param name defines the control name
@@ -12555,7 +12658,6 @@ declare module BABYLON.GUI {
12555
12658
  * @param facadeTexture defines the AdvancedDynamicTexture to use
12556
12659
  */
12557
12660
  protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
12558
- private _rebuildContent;
12559
12661
  private _addControl;
12560
12662
  protected _getTypeName(): string;
12561
12663
  /**
@@ -12575,8 +12677,9 @@ declare module BABYLON.GUI {
12575
12677
  _prepareNode(scene: BABYLON.Scene): void;
12576
12678
  /**
12577
12679
  * Resets the aspect and pose of the slate so it is right in front of the active camera, facing towards it.
12680
+ * @param resetAspect Should the slate's dimensions/aspect ratio be reset as well
12578
12681
  */
12579
- resetDefaultAspectAndPose(): void;
12682
+ resetDefaultAspectAndPose(resetAspect?: boolean): void;
12580
12683
  /**
12581
12684
  * Releases all associated resources
12582
12685
  */
@@ -12693,7 +12796,6 @@ declare module BABYLON.GUI {
12693
12796
  */
12694
12797
  private static PIN_ICON_FILENAME;
12695
12798
  private _pinButton;
12696
- private _pinMaterial;
12697
12799
  private _dragObserver;
12698
12800
  private _defaultBehavior;
12699
12801
  /**
@@ -13062,7 +13164,7 @@ declare module BABYLON.GUI {
13062
13164
  * @hidden
13063
13165
  */
13064
13166
  globalRightIndexMiddlePosition: BABYLON.Vector4;
13065
- constructor(name: string, scene: BABYLON.Scene);
13167
+ constructor(name: string, scene?: BABYLON.Scene);
13066
13168
  needAlphaBlending(): boolean;
13067
13169
  needAlphaTesting(): boolean;
13068
13170
  getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
@@ -13398,7 +13500,7 @@ declare module BABYLON.GUI {
13398
13500
  * @hidden
13399
13501
  */
13400
13502
  globalRightIndexMiddlePosition: BABYLON.Vector4;
13401
- constructor(name: string, scene: BABYLON.Scene);
13503
+ constructor(name: string, scene?: BABYLON.Scene);
13402
13504
  needAlphaBlending(): boolean;
13403
13505
  needAlphaTesting(): boolean;
13404
13506
  getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
@@ -13549,7 +13651,7 @@ declare module BABYLON.GUI {
13549
13651
  * Gets or sets the edge width of the backplate.
13550
13652
  */
13551
13653
  edgeLineGradientBlend: number;
13552
- constructor(name: string, scene: BABYLON.Scene);
13654
+ constructor(name: string, scene?: BABYLON.Scene);
13553
13655
  needAlphaBlending(): boolean;
13554
13656
  needAlphaTesting(): boolean;
13555
13657
  getAlphaTestTexture(): BABYLON.Nullable<BABYLON.BaseTexture>;
@@ -13697,36 +13799,6 @@ declare module BABYLON.GUI {
13697
13799
  protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
13698
13800
  }
13699
13801
  }
13700
- declare module BABYLON.GUI {
13701
- /**
13702
- * Class used as base class for touch-enabled toggleable buttons
13703
- */
13704
- export class TouchToggleButton3D extends TouchButton3D {
13705
- private _isPressed;
13706
- /**
13707
- * An event triggered when the button is toggled on
13708
- */
13709
- onToggleOnObservable: BABYLON.Observable<BABYLON.Vector3>;
13710
- /**
13711
- * An event triggered when the button is toggled off
13712
- */
13713
- onToggleOffObservable: BABYLON.Observable<BABYLON.Vector3>;
13714
- /**
13715
- * Creates a new button
13716
- * @param name defines the control name
13717
- * @param collisionMesh defines the mesh to track near interactions with
13718
- */
13719
- constructor(name?: string, collisionMesh?: BABYLON.Mesh);
13720
- private _onToggle;
13721
- protected _getTypeName(): string;
13722
- protected _createNode(scene: BABYLON.Scene): BABYLON.TransformNode;
13723
- protected _affectMaterial(mesh: BABYLON.AbstractMesh): void;
13724
- /**
13725
- * Releases all associated resources
13726
- */
13727
- dispose(): void;
13728
- }
13729
- }
13730
13802
  declare module BABYLON.GUI {
13731
13803
  /**
13732
13804
  * Class used to create a holographic backplate in 3D