@babylonjs/gui 5.26.1 → 5.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/2D/controls/inputText.d.ts +1 -1
  2. package/2D/controls/inputText.js +7 -27
  3. package/2D/controls/inputText.js.map +1 -1
  4. package/3D/controls/MRTK3/touchHolographicButton.d.ts +220 -0
  5. package/3D/controls/MRTK3/touchHolographicButton.js +859 -0
  6. package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -0
  7. package/3D/controls/index.d.ts +4 -2
  8. package/3D/controls/index.js +5 -2
  9. package/3D/controls/index.js.map +1 -1
  10. package/3D/materials/mrdl/mrdlBackglowMaterial.d.ts +87 -0
  11. package/3D/materials/mrdl/mrdlBackglowMaterial.js +300 -0
  12. package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -0
  13. package/3D/materials/mrdl/mrdlFrontplateMaterial.d.ts +186 -0
  14. package/3D/materials/mrdl/mrdlFrontplateMaterial.js +530 -0
  15. package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -0
  16. package/3D/materials/mrdl/mrdlInnerquadMaterial.d.ts +56 -0
  17. package/3D/materials/mrdl/mrdlInnerquadMaterial.js +228 -0
  18. package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -0
  19. package/3D/materials/mrdl/shaders/mrdlBackglow.fragment.d.ts +5 -0
  20. package/3D/materials/mrdl/shaders/mrdlBackglow.fragment.js +9 -0
  21. package/3D/materials/mrdl/shaders/mrdlBackglow.fragment.js.map +1 -0
  22. package/3D/materials/mrdl/shaders/mrdlBackglow.vertex.d.ts +5 -0
  23. package/3D/materials/mrdl/shaders/mrdlBackglow.vertex.js +9 -0
  24. package/3D/materials/mrdl/shaders/mrdlBackglow.vertex.js.map +1 -0
  25. package/3D/materials/mrdl/shaders/mrdlFrontplate.fragment.d.ts +5 -0
  26. package/3D/materials/mrdl/shaders/mrdlFrontplate.fragment.js +9 -0
  27. package/3D/materials/mrdl/shaders/mrdlFrontplate.fragment.js.map +1 -0
  28. package/3D/materials/mrdl/shaders/mrdlFrontplate.vertex.d.ts +5 -0
  29. package/3D/materials/mrdl/shaders/mrdlFrontplate.vertex.js +9 -0
  30. package/3D/materials/mrdl/shaders/mrdlFrontplate.vertex.js.map +1 -0
  31. package/3D/materials/mrdl/shaders/mrdlInnerquad.fragment.d.ts +5 -0
  32. package/3D/materials/mrdl/shaders/mrdlInnerquad.fragment.js +9 -0
  33. package/3D/materials/mrdl/shaders/mrdlInnerquad.fragment.js.map +1 -0
  34. package/3D/materials/mrdl/shaders/mrdlInnerquad.vertex.d.ts +5 -0
  35. package/3D/materials/mrdl/shaders/mrdlInnerquad.vertex.js +9 -0
  36. package/3D/materials/mrdl/shaders/mrdlInnerquad.vertex.js.map +1 -0
  37. package/package.json +2 -2
@@ -0,0 +1,220 @@
1
+ import type { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
2
+ import type { Mesh } from "@babylonjs/core/Meshes/mesh.js";
3
+ import type { Nullable } from "@babylonjs/core/types.js";
4
+ import type { Scene } from "@babylonjs/core/scene.js";
5
+ import { AdvancedDynamicTexture } from "../../../2D/advancedDynamicTexture";
6
+ import { Color3, Color4 } from "@babylonjs/core/Maths/math.color.js";
7
+ import { MRDLBackglowMaterial } from "../../materials/mrdl/mrdlBackglowMaterial";
8
+ import { MRDLBackplateMaterial } from "../../materials/mrdl/mrdlBackplateMaterial";
9
+ import { MRDLFrontplateMaterial } from "../../materials/mrdl/mrdlFrontplateMaterial";
10
+ import { MRDLInnerquadMaterial } from "../../materials/mrdl/mrdlInnerquadMaterial";
11
+ import { StandardMaterial } from "@babylonjs/core/Materials/standardMaterial.js";
12
+ import { TouchButton3D } from "../touchButton3D";
13
+ import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
14
+ /**
15
+ * Class used to create the mrtkv3 button
16
+ */
17
+ export declare class TouchHolographicButton extends TouchButton3D {
18
+ /**
19
+ * Base Url for the frontplate model.
20
+ */
21
+ static MRTK_ASSET_BASE_URL: string;
22
+ /**
23
+ * File name for the frontplate model.
24
+ */
25
+ static FRONTPLATE_MODEL_FILENAME: string;
26
+ /**
27
+ * File name for the backplate model.
28
+ */
29
+ static BACKPLATE_MODEL_FILENAME: string;
30
+ /**
31
+ * File name for the backglow model.
32
+ */
33
+ static BACKGLOW_MODEL_FILENAME: string;
34
+ /**
35
+ * File name for the innerquad model.
36
+ */
37
+ static INNERQUAD_MODEL_FILENAME: string;
38
+ /**
39
+ * Gets or sets the horizontal scaling for the button.
40
+ */
41
+ width: number;
42
+ /**
43
+ * Gets or sets the vertical scaling for the button.
44
+ */
45
+ height: number;
46
+ /**
47
+ * Gets or sets the bevel radius for the button.
48
+ */
49
+ radius: number;
50
+ /**
51
+ * Gets or sets the font size of the button text in pixels.
52
+ * This is only adjustable for a button with width to height ratio greater than 1.
53
+ */
54
+ textSizeInPixels: number;
55
+ /**
56
+ * Gets or sets the size of the button image in pixels.
57
+ * This is only adjustable for a button with width to height ratio greater than 1.
58
+ */
59
+ imageSizeInPixels: number;
60
+ /**
61
+ * Gets or sets the color of the button plate.
62
+ */
63
+ plateMaterialColor: Color3;
64
+ /**
65
+ * Gets or sets the depth of the button's front plate.
66
+ * This variable determines the z scaling and z position for some of the button's meshes.
67
+ */
68
+ frontPlateDepth: number;
69
+ /**
70
+ * Gets or sets the depth of the button's back plate.
71
+ * This variable determines the z scaling and z position for some of the button's meshes.
72
+ */
73
+ backPlateDepth: number;
74
+ /**
75
+ * Gets or sets the offset value for button's back glow.
76
+ * This variable determines the x, y scaling of the button's meshes.
77
+ */
78
+ backGlowOffset: number;
79
+ /**
80
+ * Gets or sets the value that determines the z scaling and z position for the innerQuad and BackGlow meshes.
81
+ */
82
+ flatPlaneDepth: number;
83
+ /**
84
+ * Gets or sets the radius for FrontMaterial and innerQuadMaterial.
85
+ */
86
+ innerQuadRadius: number;
87
+ /**
88
+ * Gets or sets the color for innerQuadMaterial.
89
+ */
90
+ innerQuadColor: Color4;
91
+ /**
92
+ * Gets or sets the color for innerQuadMaterial for when it is toggled.
93
+ */
94
+ innerQuadToggledColor: Color4;
95
+ /**
96
+ * Gets or sets the color for innerQuadMaterial for when it is hovered.
97
+ */
98
+ innerQuadHoverColor: Color4;
99
+ /**
100
+ * Gets or sets the color for innerQuadMaterial for when it is toggled and hovered.
101
+ */
102
+ innerQuadToggledHoverColor: Color4;
103
+ private _backPlate;
104
+ private _textPlate;
105
+ private _frontPlate;
106
+ private _backGlow;
107
+ private _innerQuad;
108
+ private _collisionPlate;
109
+ private _frontPlateCollisionMesh;
110
+ private _isBackplateVisible;
111
+ private _text;
112
+ private _subtext;
113
+ private _imageUrl;
114
+ private _shareMaterials;
115
+ private _frontMaterial;
116
+ private _backMaterial;
117
+ private _backGlowMaterial;
118
+ private _innerQuadMaterial;
119
+ private _plateMaterial;
120
+ private _pickedPointObserver;
121
+ private _pointerClickObserver;
122
+ private _pointerEnterObserver;
123
+ private _pointerOutObserver;
124
+ private _toggleObserver;
125
+ private _tooltipFade;
126
+ private _tooltipTextBlock;
127
+ private _tooltipTexture;
128
+ private _tooltipMesh;
129
+ private _tooltipHoverObserver;
130
+ private _tooltipOutObserver;
131
+ private _disposeTooltip;
132
+ /**
133
+ * Rendering ground id of all the mesh in the button
134
+ */
135
+ set renderingGroupId(id: number);
136
+ get renderingGroupId(): number;
137
+ /**
138
+ * Gets the mesh used to render this control
139
+ */
140
+ get mesh(): Nullable<AbstractMesh>;
141
+ /**
142
+ * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)
143
+ * Set this property after adding the button to the GUI3DManager
144
+ */
145
+ set tooltipText(text: Nullable<string>);
146
+ get tooltipText(): Nullable<string>;
147
+ /**
148
+ * Gets or sets text for the button
149
+ */
150
+ get text(): string;
151
+ set text(value: string);
152
+ /**
153
+ * Gets or sets subtext for a button with larger width
154
+ */
155
+ get subtext(): string;
156
+ set subtext(value: string);
157
+ /**
158
+ * Gets or sets the image url for the button
159
+ */
160
+ get imageUrl(): string;
161
+ set imageUrl(value: string);
162
+ /**
163
+ * Gets the back material used by this button
164
+ */
165
+ get backMaterial(): MRDLBackplateMaterial;
166
+ /**
167
+ * Gets the front material used by this button
168
+ */
169
+ get frontMaterial(): MRDLFrontplateMaterial;
170
+ /**
171
+ * Gets the back glow material used by this button
172
+ */
173
+ get backGlowMaterial(): MRDLBackglowMaterial;
174
+ /**
175
+ * Gets the inner quad material used by this button
176
+ */
177
+ get innerQuadMaterial(): MRDLInnerquadMaterial;
178
+ /**
179
+ * Gets the plate material used by this button
180
+ */
181
+ get plateMaterial(): StandardMaterial;
182
+ /**
183
+ * Gets a boolean indicating if this button shares its material with other V3 Buttons
184
+ */
185
+ get shareMaterials(): boolean;
186
+ /**
187
+ * Sets whether the backplate is visible or hidden. Hiding the backplate is not recommended without some sort of replacement
188
+ */
189
+ set isBackplateVisible(isVisible: boolean);
190
+ /**
191
+ * Creates a new button
192
+ * @param name defines the control name
193
+ * @param shareMaterials
194
+ */
195
+ constructor(name?: string, shareMaterials?: boolean);
196
+ protected _getTypeName(): string;
197
+ private _rebuildContent;
198
+ private _getAspectRatio;
199
+ private _alignContentVertically;
200
+ private _alignContentHorizontally;
201
+ protected _createNode(scene: Scene): TransformNode;
202
+ private _createBackPlate;
203
+ private _createFrontPlate;
204
+ private _createInnerQuad;
205
+ private _createBackGlow;
206
+ protected _applyFacade(facadeTexture: AdvancedDynamicTexture): void;
207
+ private _performClickAnimation;
208
+ private _performEnterExitAnimation;
209
+ private _createBackMaterial;
210
+ private _createFrontMaterial;
211
+ private _createBackGlowMaterial;
212
+ private _createInnerQuadMaterial;
213
+ private _createPlateMaterial;
214
+ protected _onToggle(newState: boolean): void;
215
+ protected _affectMaterial(mesh: Mesh): void;
216
+ /**
217
+ * Releases all associated resources
218
+ */
219
+ dispose(): void;
220
+ }