@babylonjs/gui 5.0.0-beta.9 → 5.0.0-rc.10
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.
- package/2D/adtInstrumentation.d.ts +52 -52
- package/2D/adtInstrumentation.js +126 -126
- package/2D/adtInstrumentation.js.map +1 -1
- package/2D/advancedDynamicTexture.d.ts +449 -412
- package/2D/advancedDynamicTexture.js +1318 -1239
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/button.d.ts +135 -97
- package/2D/controls/button.js +276 -238
- package/2D/controls/button.js.map +1 -1
- package/2D/controls/checkbox.d.ts +59 -51
- package/2D/controls/checkbox.js +188 -178
- package/2D/controls/checkbox.js.map +1 -1
- package/2D/controls/colorpicker.d.ts +103 -90
- package/2D/controls/colorpicker.js +1417 -1400
- package/2D/controls/colorpicker.js.map +1 -1
- package/2D/controls/container.d.ts +175 -130
- package/2D/controls/container.js +570 -525
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/control.d.ts +866 -743
- package/2D/controls/control.js +2433 -2308
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/displayGrid.d.ts +53 -55
- package/2D/controls/displayGrid.js +245 -245
- package/2D/controls/displayGrid.js.map +1 -1
- package/2D/controls/ellipse.d.ts +21 -21
- package/2D/controls/ellipse.js +85 -85
- package/2D/controls/ellipse.js.map +1 -1
- package/2D/controls/focusableButton.d.ts +59 -52
- package/2D/controls/focusableButton.js +99 -92
- package/2D/controls/focusableButton.js.map +1 -1
- package/2D/controls/focusableControl.d.ts +34 -34
- package/2D/controls/focusableControl.js +1 -1
- package/2D/controls/focusableControl.js.map +1 -1
- package/2D/controls/grid.d.ts +139 -135
- package/2D/controls/grid.js +529 -525
- package/2D/controls/grid.js.map +1 -1
- package/2D/controls/image.d.ts +204 -197
- package/2D/controls/image.js +887 -879
- package/2D/controls/image.js.map +1 -1
- package/2D/controls/index.d.ts +29 -29
- package/2D/controls/index.js +29 -29
- package/2D/controls/index.js.map +1 -1
- package/2D/controls/inputPassword.d.ts +9 -8
- package/2D/controls/inputPassword.js +28 -25
- package/2D/controls/inputPassword.js.map +1 -1
- package/2D/controls/inputText.d.ts +201 -180
- package/2D/controls/inputText.js +1119 -1095
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/line.d.ts +66 -66
- package/2D/controls/line.js +271 -271
- package/2D/controls/line.js.map +1 -1
- package/2D/controls/multiLine.d.ts +75 -77
- package/2D/controls/multiLine.js +262 -262
- package/2D/controls/multiLine.js.map +1 -1
- package/2D/controls/radioButton.d.ts +49 -49
- package/2D/controls/radioButton.js +205 -205
- package/2D/controls/radioButton.js.map +1 -1
- package/2D/controls/rectangle.d.ts +29 -29
- package/2D/controls/rectangle.js +150 -150
- package/2D/controls/rectangle.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.d.ts +182 -175
- package/2D/controls/scrollViewers/scrollViewer.js +677 -676
- package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewerWindow.d.ts +57 -45
- package/2D/controls/scrollViewers/scrollViewerWindow.js +278 -263
- package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
- package/2D/controls/selector.d.ts +263 -209
- package/2D/controls/selector.js +692 -629
- package/2D/controls/selector.js.map +1 -1
- package/2D/controls/sliders/baseSlider.d.ts +82 -78
- package/2D/controls/sliders/baseSlider.js +347 -343
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.d.ts +49 -47
- package/2D/controls/sliders/imageBasedSlider.js +192 -188
- package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
- package/2D/controls/sliders/imageScrollBar.d.ts +65 -61
- package/2D/controls/sliders/imageScrollBar.js +263 -256
- package/2D/controls/sliders/imageScrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.d.ts +38 -34
- package/2D/controls/sliders/scrollBar.js +143 -136
- package/2D/controls/sliders/scrollBar.js.map +1 -1
- package/2D/controls/sliders/slider.d.ts +35 -37
- package/2D/controls/sliders/slider.js +271 -271
- package/2D/controls/sliders/slider.js.map +1 -1
- package/2D/controls/stackPanel.d.ts +64 -56
- package/2D/controls/stackPanel.js +246 -236
- package/2D/controls/stackPanel.js.map +1 -1
- package/2D/controls/statics.d.ts +6 -6
- package/2D/controls/statics.js +49 -47
- package/2D/controls/statics.js.map +1 -1
- package/2D/controls/textBlock.d.ts +175 -171
- package/2D/controls/textBlock.js +603 -588
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/controls/textWrapper.d.ts +13 -13
- package/2D/controls/textWrapper.js +101 -101
- package/2D/controls/textWrapper.js.map +1 -1
- package/2D/controls/toggleButton.d.ts +117 -83
- package/2D/controls/toggleButton.js +268 -234
- package/2D/controls/toggleButton.js.map +1 -1
- package/2D/controls/virtualKeyboard.d.ts +96 -96
- package/2D/controls/virtualKeyboard.js +256 -256
- package/2D/controls/virtualKeyboard.js.map +1 -1
- package/2D/index.d.ts +9 -9
- package/2D/index.js +10 -9
- package/2D/index.js.map +1 -1
- package/2D/math2D.d.ts +117 -117
- package/2D/math2D.js +221 -221
- package/2D/math2D.js.map +1 -1
- package/2D/measure.d.ts +77 -77
- package/2D/measure.js +139 -149
- package/2D/measure.js.map +1 -1
- package/2D/multiLinePoint.d.ts +47 -47
- package/2D/multiLinePoint.js +127 -127
- package/2D/multiLinePoint.js.map +1 -1
- package/2D/style.d.ts +46 -46
- package/2D/style.js +97 -97
- package/2D/style.js.map +1 -1
- package/2D/valueAndUnit.d.ts +89 -89
- package/2D/valueAndUnit.js +226 -222
- package/2D/valueAndUnit.js.map +1 -1
- package/2D/xmlLoader.d.ts +60 -60
- package/2D/xmlLoader.js +348 -341
- package/2D/xmlLoader.js.map +1 -1
- package/3D/behaviors/defaultBehavior.d.ts +73 -73
- package/3D/behaviors/defaultBehavior.js +121 -121
- package/3D/behaviors/defaultBehavior.js.map +1 -1
- package/3D/controls/abstractButton3D.d.ts +15 -15
- package/3D/controls/abstractButton3D.js +25 -25
- package/3D/controls/abstractButton3D.js.map +1 -1
- package/3D/controls/button3D.d.ts +30 -30
- package/3D/controls/button3D.js +93 -93
- package/3D/controls/button3D.js.map +1 -1
- package/3D/controls/container3D.d.ts +72 -72
- package/3D/controls/container3D.js +139 -140
- package/3D/controls/container3D.js.map +1 -1
- package/3D/controls/contentDisplay3D.d.ts +30 -30
- package/3D/controls/contentDisplay3D.js +79 -78
- package/3D/controls/contentDisplay3D.js.map +1 -1
- package/3D/controls/control3D.d.ts +201 -165
- package/3D/controls/control3D.js +445 -408
- package/3D/controls/control3D.js.map +1 -1
- package/3D/controls/cylinderPanel.d.ts +17 -17
- package/3D/controls/cylinderPanel.js +66 -66
- package/3D/controls/cylinderPanel.js.map +1 -1
- package/3D/controls/handMenu.d.ts +28 -28
- package/3D/controls/handMenu.js +47 -47
- package/3D/controls/handMenu.js.map +1 -1
- package/3D/controls/holographicBackplate.d.ts +49 -48
- package/3D/controls/holographicBackplate.js +120 -120
- package/3D/controls/holographicBackplate.js.map +1 -1
- package/3D/controls/holographicButton.d.ts +84 -83
- package/3D/controls/holographicButton.js +339 -338
- package/3D/controls/holographicButton.js.map +1 -1
- package/3D/controls/holographicSlate.d.ts +131 -118
- package/3D/controls/holographicSlate.js +431 -369
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/index.d.ts +21 -21
- package/3D/controls/index.js +21 -21
- package/3D/controls/index.js.map +1 -1
- package/3D/controls/meshButton3D.d.ts +21 -21
- package/3D/controls/meshButton3D.js +62 -61
- package/3D/controls/meshButton3D.js.map +1 -1
- package/3D/controls/nearMenu.d.ts +44 -44
- package/3D/controls/nearMenu.js +114 -112
- package/3D/controls/nearMenu.js.map +1 -1
- package/3D/controls/planePanel.d.ts +9 -9
- package/3D/controls/planePanel.js +36 -36
- package/3D/controls/planePanel.js.map +1 -1
- package/3D/controls/scatterPanel.d.ts +18 -18
- package/3D/controls/scatterPanel.js +108 -108
- package/3D/controls/scatterPanel.js.map +1 -1
- package/3D/controls/slider3D.d.ts +81 -80
- package/3D/controls/slider3D.js +268 -267
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/spherePanel.d.ts +17 -17
- package/3D/controls/spherePanel.js +67 -67
- package/3D/controls/spherePanel.js.map +1 -1
- package/3D/controls/stackPanel3D.d.ts +22 -22
- package/3D/controls/stackPanel3D.js +107 -107
- package/3D/controls/stackPanel3D.js.map +1 -1
- package/3D/controls/touchButton3D.d.ts +80 -64
- package/3D/controls/touchButton3D.js +233 -188
- package/3D/controls/touchButton3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.d.ts +110 -104
- package/3D/controls/touchHolographicButton.js +445 -432
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/controls/touchHolographicMenu.d.ts +61 -61
- package/3D/controls/touchHolographicMenu.js +149 -148
- package/3D/controls/touchHolographicMenu.js.map +1 -1
- package/3D/controls/touchMeshButton3D.d.ts +21 -22
- package/3D/controls/touchMeshButton3D.js +62 -62
- package/3D/controls/touchMeshButton3D.js.map +1 -1
- package/3D/controls/volumeBasedPanel.d.ts +53 -52
- package/3D/controls/volumeBasedPanel.js +174 -174
- package/3D/controls/volumeBasedPanel.js.map +1 -1
- package/3D/gizmos/gizmoHandle.d.ts +108 -108
- package/3D/gizmos/gizmoHandle.js +209 -209
- package/3D/gizmos/gizmoHandle.js.map +1 -1
- package/3D/gizmos/index.d.ts +2 -2
- package/3D/gizmos/index.js +2 -2
- package/3D/gizmos/index.js.map +1 -1
- package/3D/gizmos/slateGizmo.d.ts +57 -59
- package/3D/gizmos/slateGizmo.js +369 -363
- package/3D/gizmos/slateGizmo.js.map +1 -1
- package/3D/gui3DManager.d.ts +94 -94
- package/3D/gui3DManager.js +257 -257
- package/3D/gui3DManager.js.map +1 -1
- package/3D/index.d.ts +5 -5
- package/3D/index.js +6 -5
- package/3D/index.js.map +1 -1
- package/3D/materials/fluent/fluentMaterial.d.ts +91 -90
- package/3D/materials/fluent/fluentMaterial.js +292 -281
- package/3D/materials/fluent/fluentMaterial.js.map +1 -1
- package/3D/materials/fluent/index.d.ts +1 -1
- package/3D/materials/fluent/index.js +1 -1
- package/3D/materials/fluent/index.js.map +1 -1
- package/3D/materials/fluent/shaders/fluent.fragment.d.ts +5 -5
- package/3D/materials/fluent/shaders/fluent.fragment.js +8 -6
- package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
- package/3D/materials/fluent/shaders/fluent.vertex.d.ts +5 -5
- package/3D/materials/fluent/shaders/fluent.vertex.js +8 -6
- package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.d.ts +155 -154
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +469 -434
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/3D/materials/fluentBackplate/index.d.ts +1 -1
- package/3D/materials/fluentBackplate/index.js +1 -1
- package/3D/materials/fluentBackplate/index.js.map +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.d.ts +5 -5
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +8 -6
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.d.ts +5 -5
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +8 -6
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.d.ts +190 -189
- package/3D/materials/fluentButton/fluentButtonMaterial.js +539 -537
- package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
- package/3D/materials/fluentButton/index.d.ts +1 -1
- package/3D/materials/fluentButton/index.js +1 -1
- package/3D/materials/fluentButton/index.js.map +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.d.ts +5 -5
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +8 -6
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.d.ts +5 -5
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +8 -6
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
- package/3D/materials/fluentMaterial.d.ts +4 -4
- package/3D/materials/fluentMaterial.js +4 -4
- package/3D/materials/fluentMaterial.js.map +1 -1
- package/3D/materials/handle/handleMaterial.d.ts +68 -68
- package/3D/materials/handle/handleMaterial.js +126 -126
- package/3D/materials/handle/handleMaterial.js.map +1 -1
- package/3D/materials/handle/index.d.ts +1 -1
- package/3D/materials/handle/index.js +1 -1
- package/3D/materials/handle/index.js.map +1 -1
- package/3D/materials/handle/shaders/handle.fragment.d.ts +5 -5
- package/3D/materials/handle/shaders/handle.fragment.js +8 -6
- package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
- package/3D/materials/handle/shaders/handle.vertex.d.ts +5 -5
- package/3D/materials/handle/shaders/handle.vertex.js +8 -6
- package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
- package/3D/materials/index.d.ts +5 -5
- package/3D/materials/index.js +6 -5
- package/3D/materials/index.js.map +1 -1
- package/3D/materials/mrdl/index.d.ts +3 -3
- package/3D/materials/mrdl/index.js +3 -3
- package/3D/materials/mrdl/index.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.d.ts +148 -147
- package/3D/materials/mrdl/mrdlBackplateMaterial.js +436 -409
- package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.d.ts +334 -333
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js +851 -786
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.d.ts +334 -333
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +851 -786
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +8 -6
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +8 -6
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +8 -6
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +8 -6
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +8 -6
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.d.ts +5 -5
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +8 -6
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
- package/3D/vector3WithInfo.d.ts +16 -16
- package/3D/vector3WithInfo.js +23 -23
- package/3D/vector3WithInfo.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +3 -2
- package/index.js.map +1 -1
- package/legacy/legacy.d.ts +1 -1
- package/legacy/legacy.js +14 -13
- package/legacy/legacy.js.map +1 -1
- package/package.json +21 -328
- package/readme.md +2 -2
|
@@ -1,141 +1,140 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
|
3
|
-
import { Control3D } from "./control3D
|
|
4
|
-
/**
|
|
5
|
-
* Class used to create containers for controls
|
|
6
|
-
*/
|
|
7
|
-
var Container3D = /** @class */ (function (_super) {
|
|
8
|
-
__extends(Container3D, _super);
|
|
9
|
-
/**
|
|
10
|
-
* Creates a new container
|
|
11
|
-
* @param name defines the container name
|
|
12
|
-
*/
|
|
13
|
-
function Container3D(name) {
|
|
14
|
-
var _this = _super.call(this, name) || this;
|
|
15
|
-
_this._blockLayout = false;
|
|
16
|
-
/**
|
|
17
|
-
* Gets the list of child controls
|
|
18
|
-
*/
|
|
19
|
-
_this._children = new Array();
|
|
20
|
-
return _this;
|
|
21
|
-
}
|
|
22
|
-
Object.defineProperty(Container3D.prototype, "children", {
|
|
23
|
-
/**
|
|
24
|
-
* Gets the list of child controls
|
|
25
|
-
*/
|
|
26
|
-
get: function () {
|
|
27
|
-
return this._children;
|
|
28
|
-
},
|
|
29
|
-
enumerable: false,
|
|
30
|
-
configurable: true
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(Container3D.prototype, "blockLayout", {
|
|
33
|
-
/**
|
|
34
|
-
* Gets or sets a boolean indicating if the layout must be blocked (default is false).
|
|
35
|
-
* This is helpful to optimize layout operation when adding multiple children in a row
|
|
36
|
-
*/
|
|
37
|
-
get: function () {
|
|
38
|
-
return this._blockLayout;
|
|
39
|
-
},
|
|
40
|
-
set: function (value) {
|
|
41
|
-
if (this._blockLayout === value) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
this._blockLayout = value;
|
|
45
|
-
if (!this._blockLayout) {
|
|
46
|
-
this._arrangeChildren();
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
enumerable: false,
|
|
50
|
-
configurable: true
|
|
51
|
-
});
|
|
52
|
-
/**
|
|
53
|
-
* Force the container to update the layout. Please note that it will not take blockLayout property in account
|
|
54
|
-
* @returns the current container
|
|
55
|
-
*/
|
|
56
|
-
Container3D.prototype.updateLayout = function () {
|
|
57
|
-
this._arrangeChildren();
|
|
58
|
-
return this;
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Gets a boolean indicating if the given control is in the children of this control
|
|
62
|
-
* @param control defines the control to check
|
|
63
|
-
* @returns true if the control is in the child list
|
|
64
|
-
*/
|
|
65
|
-
Container3D.prototype.containsControl = function (control) {
|
|
66
|
-
return this._children.indexOf(control) !== -1;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Adds a control to the children of this control
|
|
70
|
-
* @param control defines the control to add
|
|
71
|
-
* @returns the current container
|
|
72
|
-
*/
|
|
73
|
-
Container3D.prototype.addControl = function (control) {
|
|
74
|
-
var index = this._children.indexOf(control);
|
|
75
|
-
if (index !== -1) {
|
|
76
|
-
return this;
|
|
77
|
-
}
|
|
78
|
-
control.parent = this;
|
|
79
|
-
control._host = this._host;
|
|
80
|
-
this._children.push(control);
|
|
81
|
-
if (this._host.utilityLayer) {
|
|
82
|
-
control._prepareNode(this._host.utilityLayer.utilityLayerScene);
|
|
83
|
-
if (control.node) {
|
|
84
|
-
control.node.parent = this.node;
|
|
85
|
-
}
|
|
86
|
-
if (!this.blockLayout) {
|
|
87
|
-
this._arrangeChildren();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return this;
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* This function will be called everytime a new control is added
|
|
94
|
-
*/
|
|
95
|
-
Container3D.prototype._arrangeChildren = function () {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
*
|
|
102
|
-
* @
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
control.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
Container3D
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
export { Container3D };
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
|
|
3
|
+
import { Control3D } from "./control3D";
|
|
4
|
+
/**
|
|
5
|
+
* Class used to create containers for controls
|
|
6
|
+
*/
|
|
7
|
+
var Container3D = /** @class */ (function (_super) {
|
|
8
|
+
__extends(Container3D, _super);
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new container
|
|
11
|
+
* @param name defines the container name
|
|
12
|
+
*/
|
|
13
|
+
function Container3D(name) {
|
|
14
|
+
var _this = _super.call(this, name) || this;
|
|
15
|
+
_this._blockLayout = false;
|
|
16
|
+
/**
|
|
17
|
+
* Gets the list of child controls
|
|
18
|
+
*/
|
|
19
|
+
_this._children = new Array();
|
|
20
|
+
return _this;
|
|
21
|
+
}
|
|
22
|
+
Object.defineProperty(Container3D.prototype, "children", {
|
|
23
|
+
/**
|
|
24
|
+
* Gets the list of child controls
|
|
25
|
+
*/
|
|
26
|
+
get: function () {
|
|
27
|
+
return this._children;
|
|
28
|
+
},
|
|
29
|
+
enumerable: false,
|
|
30
|
+
configurable: true
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(Container3D.prototype, "blockLayout", {
|
|
33
|
+
/**
|
|
34
|
+
* Gets or sets a boolean indicating if the layout must be blocked (default is false).
|
|
35
|
+
* This is helpful to optimize layout operation when adding multiple children in a row
|
|
36
|
+
*/
|
|
37
|
+
get: function () {
|
|
38
|
+
return this._blockLayout;
|
|
39
|
+
},
|
|
40
|
+
set: function (value) {
|
|
41
|
+
if (this._blockLayout === value) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this._blockLayout = value;
|
|
45
|
+
if (!this._blockLayout) {
|
|
46
|
+
this._arrangeChildren();
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
enumerable: false,
|
|
50
|
+
configurable: true
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Force the container to update the layout. Please note that it will not take blockLayout property in account
|
|
54
|
+
* @returns the current container
|
|
55
|
+
*/
|
|
56
|
+
Container3D.prototype.updateLayout = function () {
|
|
57
|
+
this._arrangeChildren();
|
|
58
|
+
return this;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Gets a boolean indicating if the given control is in the children of this control
|
|
62
|
+
* @param control defines the control to check
|
|
63
|
+
* @returns true if the control is in the child list
|
|
64
|
+
*/
|
|
65
|
+
Container3D.prototype.containsControl = function (control) {
|
|
66
|
+
return this._children.indexOf(control) !== -1;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Adds a control to the children of this control
|
|
70
|
+
* @param control defines the control to add
|
|
71
|
+
* @returns the current container
|
|
72
|
+
*/
|
|
73
|
+
Container3D.prototype.addControl = function (control) {
|
|
74
|
+
var index = this._children.indexOf(control);
|
|
75
|
+
if (index !== -1) {
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
control.parent = this;
|
|
79
|
+
control._host = this._host;
|
|
80
|
+
this._children.push(control);
|
|
81
|
+
if (this._host.utilityLayer) {
|
|
82
|
+
control._prepareNode(this._host.utilityLayer.utilityLayerScene);
|
|
83
|
+
if (control.node) {
|
|
84
|
+
control.node.parent = this.node;
|
|
85
|
+
}
|
|
86
|
+
if (!this.blockLayout) {
|
|
87
|
+
this._arrangeChildren();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return this;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* This function will be called everytime a new control is added
|
|
94
|
+
*/
|
|
95
|
+
Container3D.prototype._arrangeChildren = function () { };
|
|
96
|
+
Container3D.prototype._createNode = function (scene) {
|
|
97
|
+
return new TransformNode("ContainerNode", scene);
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Removes a control from the children of this control
|
|
101
|
+
* @param control defines the control to remove
|
|
102
|
+
* @returns the current container
|
|
103
|
+
*/
|
|
104
|
+
Container3D.prototype.removeControl = function (control) {
|
|
105
|
+
var index = this._children.indexOf(control);
|
|
106
|
+
if (index !== -1) {
|
|
107
|
+
this._children.splice(index, 1);
|
|
108
|
+
control.parent = null;
|
|
109
|
+
control._disposeNode();
|
|
110
|
+
}
|
|
111
|
+
return this;
|
|
112
|
+
};
|
|
113
|
+
Container3D.prototype._getTypeName = function () {
|
|
114
|
+
return "Container3D";
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Releases all associated resources
|
|
118
|
+
*/
|
|
119
|
+
Container3D.prototype.dispose = function () {
|
|
120
|
+
for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
|
|
121
|
+
var control = _a[_i];
|
|
122
|
+
control.dispose();
|
|
123
|
+
}
|
|
124
|
+
this._children = [];
|
|
125
|
+
_super.prototype.dispose.call(this);
|
|
126
|
+
};
|
|
127
|
+
/** Control rotation will remain unchanged */
|
|
128
|
+
Container3D.UNSET_ORIENTATION = 0;
|
|
129
|
+
/** Control will rotate to make it look at sphere central axis */
|
|
130
|
+
Container3D.FACEORIGIN_ORIENTATION = 1;
|
|
131
|
+
/** Control will rotate to make it look back at sphere central axis */
|
|
132
|
+
Container3D.FACEORIGINREVERSED_ORIENTATION = 2;
|
|
133
|
+
/** Control will rotate to look at z axis (0, 0, 1) */
|
|
134
|
+
Container3D.FACEFORWARD_ORIENTATION = 3;
|
|
135
|
+
/** Control will rotate to look at negative z axis (0, 0, -1) */
|
|
136
|
+
Container3D.FACEFORWARDREVERSED_ORIENTATION = 4;
|
|
137
|
+
return Container3D;
|
|
138
|
+
}(Control3D));
|
|
139
|
+
export { Container3D };
|
|
141
140
|
//# sourceMappingURL=container3D.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container3D.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"container3D.js","sourceRoot":"","sources":["../../../../../../lts/gui/generated/3D/controls/container3D.ts"],"names":[],"mappings":"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","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport { Control3D } from \"./control3D\";\r\n\r\n/**\r\n * Class used to create containers for controls\r\n */\r\nexport class Container3D extends Control3D {\r\n private _blockLayout = false;\r\n\r\n /**\r\n * Gets the list of child controls\r\n */\r\n protected _children = new Array<Control3D>();\r\n\r\n /**\r\n * Gets the list of child controls\r\n */\r\n public get children(): Array<Control3D> {\r\n return this._children;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the layout must be blocked (default is false).\r\n * This is helpful to optimize layout operation when adding multiple children in a row\r\n */\r\n public get blockLayout(): boolean {\r\n return this._blockLayout;\r\n }\r\n\r\n public set blockLayout(value: boolean) {\r\n if (this._blockLayout === value) {\r\n return;\r\n }\r\n\r\n this._blockLayout = value;\r\n\r\n if (!this._blockLayout) {\r\n this._arrangeChildren();\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new container\r\n * @param name defines the container name\r\n */\r\n constructor(name?: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Force the container to update the layout. Please note that it will not take blockLayout property in account\r\n * @returns the current container\r\n */\r\n public updateLayout(): Container3D {\r\n this._arrangeChildren();\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the given control is in the children of this control\r\n * @param control defines the control to check\r\n * @returns true if the control is in the child list\r\n */\r\n public containsControl(control: Control3D): boolean {\r\n return this._children.indexOf(control) !== -1;\r\n }\r\n\r\n /**\r\n * Adds a control to the children of this control\r\n * @param control defines the control to add\r\n * @returns the current container\r\n */\r\n public addControl(control: Control3D): Container3D {\r\n const index = this._children.indexOf(control);\r\n\r\n if (index !== -1) {\r\n return this;\r\n }\r\n control.parent = this;\r\n control._host = this._host;\r\n\r\n this._children.push(control);\r\n\r\n if (this._host.utilityLayer) {\r\n control._prepareNode(this._host.utilityLayer.utilityLayerScene);\r\n\r\n if (control.node) {\r\n control.node.parent = this.node;\r\n }\r\n\r\n if (!this.blockLayout) {\r\n this._arrangeChildren();\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * This function will be called everytime a new control is added\r\n */\r\n protected _arrangeChildren() {}\r\n\r\n protected _createNode(scene: Scene): Nullable<TransformNode> {\r\n return new TransformNode(\"ContainerNode\", scene);\r\n }\r\n\r\n /**\r\n * Removes a control from the children of this control\r\n * @param control defines the control to remove\r\n * @returns the current container\r\n */\r\n public removeControl(control: Control3D): Container3D {\r\n const index = this._children.indexOf(control);\r\n\r\n if (index !== -1) {\r\n this._children.splice(index, 1);\r\n\r\n control.parent = null;\r\n control._disposeNode();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Container3D\";\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n for (const control of this._children) {\r\n control.dispose();\r\n }\r\n\r\n this._children = [];\r\n\r\n super.dispose();\r\n }\r\n\r\n /** Control rotation will remain unchanged */\r\n public static readonly UNSET_ORIENTATION = 0;\r\n\r\n /** Control will rotate to make it look at sphere central axis */\r\n public static readonly FACEORIGIN_ORIENTATION = 1;\r\n\r\n /** Control will rotate to make it look back at sphere central axis */\r\n public static readonly FACEORIGINREVERSED_ORIENTATION = 2;\r\n\r\n /** Control will rotate to look at z axis (0, 0, 1) */\r\n public static readonly FACEFORWARD_ORIENTATION = 3;\r\n\r\n /** Control will rotate to look at negative z axis (0, 0, -1) */\r\n public static readonly FACEFORWARDREVERSED_ORIENTATION = 4;\r\n}\r\n"]}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { Control } from "../../2D/controls/control";
|
|
2
|
-
import { AdvancedDynamicTexture } from "../../2D/advancedDynamicTexture";
|
|
3
|
-
import { Control3D } from "./control3D";
|
|
4
|
-
/**
|
|
5
|
-
* The base class for controls that display content
|
|
6
|
-
*/
|
|
7
|
-
export declare class ContentDisplay3D extends Control3D {
|
|
8
|
-
private _content;
|
|
9
|
-
private _facadeTexture;
|
|
10
|
-
protected _contentResolution: number;
|
|
11
|
-
protected _contentScaleRatio: number;
|
|
12
|
-
/**
|
|
13
|
-
* Gets or sets the GUI 2D content used to display the button's facade
|
|
14
|
-
*/
|
|
15
|
-
get content(): Control;
|
|
16
|
-
set content(value: Control);
|
|
17
|
-
/**
|
|
18
|
-
* Gets or sets the texture resolution used to render content (512 by default)
|
|
19
|
-
*/
|
|
20
|
-
get contentResolution(): number;
|
|
21
|
-
set contentResolution(value: number);
|
|
22
|
-
protected _disposeFacadeTexture(): void;
|
|
23
|
-
protected _resetContent(): void;
|
|
24
|
-
/**
|
|
25
|
-
* Apply the facade texture (created from the content property).
|
|
26
|
-
* This function can be overloaded by child classes
|
|
27
|
-
* @param facadeTexture defines the AdvancedDynamicTexture to use
|
|
28
|
-
*/
|
|
29
|
-
protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
|
|
30
|
-
}
|
|
1
|
+
import type { Control } from "../../2D/controls/control";
|
|
2
|
+
import { AdvancedDynamicTexture } from "../../2D/advancedDynamicTexture";
|
|
3
|
+
import { Control3D } from "./control3D";
|
|
4
|
+
/**
|
|
5
|
+
* The base class for controls that display content
|
|
6
|
+
*/
|
|
7
|
+
export declare class ContentDisplay3D extends Control3D {
|
|
8
|
+
private _content;
|
|
9
|
+
private _facadeTexture;
|
|
10
|
+
protected _contentResolution: number;
|
|
11
|
+
protected _contentScaleRatio: number;
|
|
12
|
+
/**
|
|
13
|
+
* Gets or sets the GUI 2D content used to display the button's facade
|
|
14
|
+
*/
|
|
15
|
+
get content(): Control;
|
|
16
|
+
set content(value: Control);
|
|
17
|
+
/**
|
|
18
|
+
* Gets or sets the texture resolution used to render content (512 by default)
|
|
19
|
+
*/
|
|
20
|
+
get contentResolution(): number;
|
|
21
|
+
set contentResolution(value: number);
|
|
22
|
+
protected _disposeFacadeTexture(): void;
|
|
23
|
+
protected _resetContent(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Apply the facade texture (created from the content property).
|
|
26
|
+
* This function can be overloaded by child classes
|
|
27
|
+
* @param facadeTexture defines the AdvancedDynamicTexture to use
|
|
28
|
+
*/
|
|
29
|
+
protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
|
|
30
|
+
}
|
|
@@ -1,79 +1,80 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
import { AdvancedDynamicTexture } from "../../2D/advancedDynamicTexture
|
|
3
|
-
import { Control3D } from "./control3D
|
|
4
|
-
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
|
5
|
-
/**
|
|
6
|
-
* The base class for controls that display content
|
|
7
|
-
*/
|
|
8
|
-
var ContentDisplay3D = /** @class */ (function (_super) {
|
|
9
|
-
__extends(ContentDisplay3D, _super);
|
|
10
|
-
function ContentDisplay3D() {
|
|
11
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
12
|
-
_this._contentResolution = 512;
|
|
13
|
-
_this._contentScaleRatio = 2;
|
|
14
|
-
return _this;
|
|
15
|
-
}
|
|
16
|
-
Object.defineProperty(ContentDisplay3D.prototype, "content", {
|
|
17
|
-
/**
|
|
18
|
-
* Gets or sets the GUI 2D content used to display the button's facade
|
|
19
|
-
*/
|
|
20
|
-
get: function () {
|
|
21
|
-
return this._content;
|
|
22
|
-
},
|
|
23
|
-
set: function (value) {
|
|
24
|
-
this._content = value;
|
|
25
|
-
if (!this._host || !this._host.utilityLayer) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (!this._facadeTexture) {
|
|
29
|
-
this._facadeTexture = new AdvancedDynamicTexture("Facade", this._contentResolution, this._contentResolution, this._host.utilityLayer.utilityLayerScene, true, Texture.TRILINEAR_SAMPLINGMODE);
|
|
30
|
-
this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio;
|
|
31
|
-
this._facadeTexture.rootContainer.scaleY = this._contentScaleRatio;
|
|
32
|
-
this._facadeTexture.premulAlpha = true;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
this._facadeTexture.rootContainer.clearControls();
|
|
36
|
-
}
|
|
37
|
-
this._facadeTexture.addControl(value);
|
|
38
|
-
this._applyFacade(this._facadeTexture);
|
|
39
|
-
},
|
|
40
|
-
enumerable: false,
|
|
41
|
-
configurable: true
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(ContentDisplay3D.prototype, "contentResolution", {
|
|
44
|
-
/**
|
|
45
|
-
* Gets or sets the texture resolution used to render content (512 by default)
|
|
46
|
-
*/
|
|
47
|
-
get: function () {
|
|
48
|
-
return this._contentResolution;
|
|
49
|
-
},
|
|
50
|
-
set: function (value) {
|
|
51
|
-
if (this._contentResolution === value) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this._contentResolution = value;
|
|
55
|
-
this._resetContent();
|
|
56
|
-
},
|
|
57
|
-
enumerable: false,
|
|
58
|
-
configurable: true
|
|
59
|
-
});
|
|
60
|
-
ContentDisplay3D.prototype._disposeFacadeTexture = function () {
|
|
61
|
-
if (this._facadeTexture) {
|
|
62
|
-
this._facadeTexture.dispose();
|
|
63
|
-
this._facadeTexture = null;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
ContentDisplay3D.prototype._resetContent = function () {
|
|
67
|
-
this._disposeFacadeTexture();
|
|
68
|
-
this.content = this._content;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Apply the facade texture (created from the content property).
|
|
72
|
-
* This function can be overloaded by child classes
|
|
73
|
-
* @param facadeTexture defines the AdvancedDynamicTexture to use
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { AdvancedDynamicTexture } from "../../2D/advancedDynamicTexture";
|
|
3
|
+
import { Control3D } from "./control3D";
|
|
4
|
+
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
|
5
|
+
/**
|
|
6
|
+
* The base class for controls that display content
|
|
7
|
+
*/
|
|
8
|
+
var ContentDisplay3D = /** @class */ (function (_super) {
|
|
9
|
+
__extends(ContentDisplay3D, _super);
|
|
10
|
+
function ContentDisplay3D() {
|
|
11
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
12
|
+
_this._contentResolution = 512;
|
|
13
|
+
_this._contentScaleRatio = 2;
|
|
14
|
+
return _this;
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(ContentDisplay3D.prototype, "content", {
|
|
17
|
+
/**
|
|
18
|
+
* Gets or sets the GUI 2D content used to display the button's facade
|
|
19
|
+
*/
|
|
20
|
+
get: function () {
|
|
21
|
+
return this._content;
|
|
22
|
+
},
|
|
23
|
+
set: function (value) {
|
|
24
|
+
this._content = value;
|
|
25
|
+
if (!value || !this._host || !this._host.utilityLayer) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (!this._facadeTexture) {
|
|
29
|
+
this._facadeTexture = new AdvancedDynamicTexture("Facade", this._contentResolution, this._contentResolution, this._host.utilityLayer.utilityLayerScene, true, Texture.TRILINEAR_SAMPLINGMODE);
|
|
30
|
+
this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio;
|
|
31
|
+
this._facadeTexture.rootContainer.scaleY = this._contentScaleRatio;
|
|
32
|
+
this._facadeTexture.premulAlpha = true;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this._facadeTexture.rootContainer.clearControls();
|
|
36
|
+
}
|
|
37
|
+
this._facadeTexture.addControl(value);
|
|
38
|
+
this._applyFacade(this._facadeTexture);
|
|
39
|
+
},
|
|
40
|
+
enumerable: false,
|
|
41
|
+
configurable: true
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(ContentDisplay3D.prototype, "contentResolution", {
|
|
44
|
+
/**
|
|
45
|
+
* Gets or sets the texture resolution used to render content (512 by default)
|
|
46
|
+
*/
|
|
47
|
+
get: function () {
|
|
48
|
+
return this._contentResolution;
|
|
49
|
+
},
|
|
50
|
+
set: function (value) {
|
|
51
|
+
if (this._contentResolution === value) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this._contentResolution = value;
|
|
55
|
+
this._resetContent();
|
|
56
|
+
},
|
|
57
|
+
enumerable: false,
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
60
|
+
ContentDisplay3D.prototype._disposeFacadeTexture = function () {
|
|
61
|
+
if (this._facadeTexture) {
|
|
62
|
+
this._facadeTexture.dispose();
|
|
63
|
+
this._facadeTexture = null;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
ContentDisplay3D.prototype._resetContent = function () {
|
|
67
|
+
this._disposeFacadeTexture();
|
|
68
|
+
this.content = this._content;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Apply the facade texture (created from the content property).
|
|
72
|
+
* This function can be overloaded by child classes
|
|
73
|
+
* @param facadeTexture defines the AdvancedDynamicTexture to use
|
|
74
|
+
*/
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
76
|
+
ContentDisplay3D.prototype._applyFacade = function (facadeTexture) { };
|
|
77
|
+
return ContentDisplay3D;
|
|
78
|
+
}(Control3D));
|
|
79
|
+
export { ContentDisplay3D };
|
|
79
80
|
//# sourceMappingURL=contentDisplay3D.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentDisplay3D.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"contentDisplay3D.js","sourceRoot":"","sources":["../../../../../../lts/gui/generated/3D/controls/contentDisplay3D.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAE1D;;GAEG;AACH;IAAsC,oCAAS;IAA/C;QAAA,qEA4EC;QAzEa,wBAAkB,GAAG,GAAG,CAAC;QACzB,wBAAkB,GAAG,CAAC,CAAC;;IAwErC,CAAC;IAnEG,sBAAW,qCAAO;QAHlB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aAED,UAAmB,KAAc;YAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;gBACnD,OAAO;aACV;YAED,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;gBACtB,IAAI,CAAC,cAAc,GAAG,IAAI,sBAAsB,CAC5C,QAAQ,EACR,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,iBAAiB,EACzC,IAAI,EACJ,OAAO,CAAC,sBAAsB,CACjC,CAAC;gBACF,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC;gBACnE,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC;gBACnE,IAAI,CAAC,cAAc,CAAC,WAAW,GAAG,IAAI,CAAC;aAC1C;iBAAM;gBACH,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;aACrD;YAED,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAEtC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC3C,CAAC;;;OA5BA;IAiCD,sBAAW,+CAAiB;QAH5B;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,kBAAkB,CAAC;QACnC,CAAC;aAED,UAA6B,KAAa;YACtC,IAAI,IAAI,CAAC,kBAAkB,KAAK,KAAK,EAAE;gBACnC,OAAO;aACV;YAED,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;YAChC,IAAI,CAAC,aAAa,EAAE,CAAC;QACzB,CAAC;;;OATA;IAWS,gDAAqB,GAA/B;QACI,IAAI,IAAI,CAAC,cAAc,EAAE;YACrB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;SAC9B;IACL,CAAC;IAES,wCAAa,GAAvB;QACI,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,6DAA6D;IACnD,uCAAY,GAAtB,UAAuB,aAAqC,IAAG,CAAC;IACpE,uBAAC;AAAD,CAAC,AA5ED,CAAsC,SAAS,GA4E9C","sourcesContent":["import type { Control } from \"../../2D/controls/control\";\r\nimport { AdvancedDynamicTexture } from \"../../2D/advancedDynamicTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { Control3D } from \"./control3D\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\n\r\n/**\r\n * The base class for controls that display content\r\n */\r\nexport class ContentDisplay3D extends Control3D {\r\n private _content: Control;\r\n private _facadeTexture: Nullable<AdvancedDynamicTexture>;\r\n protected _contentResolution = 512;\r\n protected _contentScaleRatio = 2;\r\n\r\n /**\r\n * Gets or sets the GUI 2D content used to display the button's facade\r\n */\r\n public get content(): Control {\r\n return this._content;\r\n }\r\n\r\n public set content(value: Control) {\r\n this._content = value;\r\n\r\n if (!value || !this._host || !this._host.utilityLayer) {\r\n return;\r\n }\r\n\r\n if (!this._facadeTexture) {\r\n this._facadeTexture = new AdvancedDynamicTexture(\r\n \"Facade\",\r\n this._contentResolution,\r\n this._contentResolution,\r\n this._host.utilityLayer.utilityLayerScene,\r\n true,\r\n Texture.TRILINEAR_SAMPLINGMODE\r\n );\r\n this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio;\r\n this._facadeTexture.rootContainer.scaleY = this._contentScaleRatio;\r\n this._facadeTexture.premulAlpha = true;\r\n } else {\r\n this._facadeTexture.rootContainer.clearControls();\r\n }\r\n\r\n this._facadeTexture.addControl(value);\r\n\r\n this._applyFacade(this._facadeTexture);\r\n }\r\n\r\n /**\r\n * Gets or sets the texture resolution used to render content (512 by default)\r\n */\r\n public get contentResolution(): number {\r\n return this._contentResolution;\r\n }\r\n\r\n public set contentResolution(value: number) {\r\n if (this._contentResolution === value) {\r\n return;\r\n }\r\n\r\n this._contentResolution = value;\r\n this._resetContent();\r\n }\r\n\r\n protected _disposeFacadeTexture() {\r\n if (this._facadeTexture) {\r\n this._facadeTexture.dispose();\r\n this._facadeTexture = null;\r\n }\r\n }\r\n\r\n protected _resetContent() {\r\n this._disposeFacadeTexture();\r\n this.content = this._content;\r\n }\r\n\r\n /**\r\n * Apply the facade texture (created from the content property).\r\n * This function can be overloaded by child classes\r\n * @param facadeTexture defines the AdvancedDynamicTexture to use\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _applyFacade(facadeTexture: AdvancedDynamicTexture) {}\r\n}\r\n"]}
|