@babylonjs/gui 5.21.0 → 5.22.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.
- package/2D/adtInstrumentation.js +70 -90
- package/2D/adtInstrumentation.js.map +1 -1
- package/2D/advancedDynamicTexture.d.ts +6 -0
- package/2D/advancedDynamicTexture.js +554 -622
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/button.js +76 -90
- package/2D/controls/button.js.map +1 -1
- package/2D/controls/checkbox.js +86 -106
- package/2D/controls/checkbox.js.map +1 -1
- package/2D/controls/colorpicker.js +395 -415
- package/2D/controls/colorpicker.js.map +1 -1
- package/2D/controls/container.js +187 -230
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/control.js +1067 -1353
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/displayGrid.js +152 -196
- package/2D/controls/displayGrid.js.map +1 -1
- package/2D/controls/ellipse.js +32 -40
- package/2D/controls/ellipse.js.map +1 -1
- package/2D/controls/focusableButton.js +30 -35
- package/2D/controls/focusableButton.js.map +1 -1
- package/2D/controls/grid.js +172 -212
- package/2D/controls/grid.js.map +1 -1
- package/2D/controls/image.js +489 -592
- package/2D/controls/image.js.map +1 -1
- package/2D/controls/inputPassword.js +9 -16
- package/2D/controls/inputPassword.js.map +1 -1
- package/2D/controls/inputText.js +380 -467
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/inputTextArea.js +234 -273
- package/2D/controls/inputTextArea.js.map +1 -1
- package/2D/controls/line.js +147 -198
- package/2D/controls/line.js.map +1 -1
- package/2D/controls/multiLine.js +87 -113
- package/2D/controls/multiLine.js.map +1 -1
- package/2D/controls/radioButton.js +106 -127
- package/2D/controls/radioButton.js.map +1 -1
- package/2D/controls/rectangle.js +60 -72
- package/2D/controls/rectangle.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.js +439 -543
- package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewerWindow.js +99 -118
- package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
- package/2D/controls/selector.js +241 -329
- package/2D/controls/selector.js.map +1 -1
- package/2D/controls/sliders/baseSlider.js +182 -230
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.js +86 -109
- package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
- package/2D/controls/sliders/imageScrollBar.js +148 -178
- package/2D/controls/sliders/imageScrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.js +64 -80
- package/2D/controls/sliders/scrollBar.js.map +1 -1
- package/2D/controls/sliders/slider.js +91 -115
- package/2D/controls/sliders/slider.js.map +1 -1
- package/2D/controls/stackPanel.js +114 -135
- package/2D/controls/stackPanel.js.map +1 -1
- package/2D/controls/statics.js +5 -5
- package/2D/controls/statics.js.map +1 -1
- package/2D/controls/textBlock.js +322 -384
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/controls/textWrapper.js +27 -41
- package/2D/controls/textWrapper.js.map +1 -1
- package/2D/controls/toggleButton.js +105 -121
- package/2D/controls/toggleButton.js.map +1 -1
- package/2D/controls/virtualKeyboard.js +101 -123
- package/2D/controls/virtualKeyboard.js.map +1 -1
- package/2D/math2D.js +62 -70
- package/2D/math2D.js.map +1 -1
- package/2D/measure.js +30 -32
- package/2D/measure.js.map +1 -1
- package/2D/multiLinePoint.js +71 -89
- package/2D/multiLinePoint.js.map +1 -1
- package/2D/style.js +55 -73
- package/2D/style.js.map +1 -1
- package/2D/valueAndUnit.js +71 -104
- package/2D/valueAndUnit.js.map +1 -1
- package/2D/xmlLoader.js +70 -84
- package/2D/xmlLoader.js.map +1 -1
- package/3D/behaviors/defaultBehavior.js +40 -59
- package/3D/behaviors/defaultBehavior.js.map +1 -1
- package/3D/controls/abstractButton3D.js +8 -12
- package/3D/controls/abstractButton3D.js.map +1 -1
- package/3D/controls/button3D.js +30 -35
- package/3D/controls/button3D.js.map +1 -1
- package/3D/controls/container3D.js +57 -71
- package/3D/controls/container3D.js.map +1 -1
- package/3D/controls/contentDisplay3D.js +47 -60
- package/3D/controls/contentDisplay3D.js.map +1 -1
- package/3D/controls/control3D.js +123 -158
- package/3D/controls/control3D.js.map +1 -1
- package/3D/controls/cylinderPanel.js +28 -38
- package/3D/controls/cylinderPanel.js.map +1 -1
- package/3D/controls/handMenu.js +20 -29
- package/3D/controls/handMenu.js.map +1 -1
- package/3D/controls/holographicBackplate.js +52 -72
- package/3D/controls/holographicBackplate.js.map +1 -1
- package/3D/controls/holographicButton.js +160 -200
- package/3D/controls/holographicButton.js.map +1 -1
- package/3D/controls/holographicSlate.js +176 -206
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/meshButton3D.js +24 -30
- package/3D/controls/meshButton3D.js.map +1 -1
- package/3D/controls/nearMenu.js +57 -71
- package/3D/controls/nearMenu.js.map +1 -1
- package/3D/controls/planePanel.js +6 -13
- package/3D/controls/planePanel.js.map +1 -1
- package/3D/controls/scatterPanel.js +43 -54
- package/3D/controls/scatterPanel.js.map +1 -1
- package/3D/controls/slider3D.js +168 -222
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/spherePanel.js +29 -39
- package/3D/controls/spherePanel.js.map +1 -1
- package/3D/controls/stackPanel3D.js +36 -49
- package/3D/controls/stackPanel3D.js.map +1 -1
- package/3D/controls/touchButton3D.js +126 -154
- package/3D/controls/touchButton3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.js +223 -272
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/controls/touchHolographicMenu.js +55 -66
- package/3D/controls/touchHolographicMenu.js.map +1 -1
- package/3D/controls/touchMeshButton3D.js +24 -30
- package/3D/controls/touchMeshButton3D.js.map +1 -1
- package/3D/controls/volumeBasedPanel.js +85 -107
- package/3D/controls/volumeBasedPanel.js.map +1 -1
- package/3D/gizmos/gizmoHandle.js +68 -103
- package/3D/gizmos/gizmoHandle.js.map +1 -1
- package/3D/gizmos/slateGizmo.js +165 -182
- package/3D/gizmos/slateGizmo.js.map +1 -1
- package/3D/gui3DManager.js +76 -101
- package/3D/gui3DManager.js.map +1 -1
- package/3D/materials/fluent/fluentMaterial.js +110 -119
- package/3D/materials/fluent/fluentMaterial.js.map +1 -1
- package/3D/materials/fluent/shaders/fluent.fragment.js +20 -3
- package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
- package/3D/materials/fluent/shaders/fluent.vertex.js +11 -3
- package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +168 -177
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +9 -3
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +15 -3
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.js +205 -213
- package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +6 -3
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +6 -3
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
- package/3D/materials/handle/handleMaterial.js +56 -69
- package/3D/materials/handle/handleMaterial.js.map +1 -1
- package/3D/materials/handle/shaders/handle.fragment.js +3 -3
- package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
- package/3D/materials/handle/shaders/handle.vertex.js +3 -3
- package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.js +158 -166
- package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js +322 -330
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +322 -330
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +9 -3
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +6 -3
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +24 -3
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +12 -3
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +24 -3
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +12 -3
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
- package/3D/vector3WithInfo.js +6 -12
- package/3D/vector3WithInfo.js.map +1 -1
- package/legacy/legacy.js +1 -1
- package/legacy/legacy.js.map +1 -1
- package/package.json +2 -5
package/2D/controls/control.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
1
|
+
import { __decorate } from "@babylonjs/core/tslib.es6.js";
|
|
2
2
|
import { Observable } from "@babylonjs/core/Misc/observable.js";
|
|
3
3
|
import { Vector2, Vector3, Matrix } from "@babylonjs/core/Maths/math.vector.js";
|
|
4
4
|
import { PointerEventTypes } from "@babylonjs/core/Events/pointerEvents.js";
|
|
@@ -14,13 +14,13 @@ import { EngineStore } from "@babylonjs/core/Engines/engineStore.js";
|
|
|
14
14
|
* Root class used for all 2D controls
|
|
15
15
|
* @see https://doc.babylonjs.com/how_to/gui#controls
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
export class Control {
|
|
18
18
|
// Functions
|
|
19
19
|
/**
|
|
20
20
|
* Creates a new control
|
|
21
21
|
* @param name defines the name of the control
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
constructor(
|
|
24
24
|
/** defines the name of the control */
|
|
25
25
|
name) {
|
|
26
26
|
this.name = name;
|
|
@@ -195,1006 +195,752 @@ var Control = /** @class */ (function () {
|
|
|
195
195
|
this._fixedRatioMasterIsWidth = true;
|
|
196
196
|
this._tmpMeasureA = new Measure(0, 0, 0, 0);
|
|
197
197
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
},
|
|
265
|
-
enumerable: false,
|
|
266
|
-
configurable: true
|
|
267
|
-
});
|
|
268
|
-
Object.defineProperty(Control.prototype, "shadowColor", {
|
|
269
|
-
/** Gets or sets a value indicating the color of the shadow (black by default ie. "#000") */
|
|
270
|
-
get: function () {
|
|
271
|
-
return this._shadowColor;
|
|
272
|
-
},
|
|
273
|
-
set: function (value) {
|
|
274
|
-
if (this._shadowColor === value) {
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
this._shadowColor = value;
|
|
278
|
-
this._markAsDirty();
|
|
279
|
-
},
|
|
280
|
-
enumerable: false,
|
|
281
|
-
configurable: true
|
|
282
|
-
});
|
|
283
|
-
Object.defineProperty(Control.prototype, "typeName", {
|
|
284
|
-
// Properties
|
|
285
|
-
/** Gets the control type name */
|
|
286
|
-
get: function () {
|
|
287
|
-
return this._getTypeName();
|
|
288
|
-
},
|
|
289
|
-
enumerable: false,
|
|
290
|
-
configurable: true
|
|
291
|
-
});
|
|
198
|
+
/**
|
|
199
|
+
* Gets or sets a boolean indicating if the control is readonly (default: false).
|
|
200
|
+
* A readonly control will still raise pointer events but will not react to them
|
|
201
|
+
*/
|
|
202
|
+
get isReadOnly() {
|
|
203
|
+
return this._isReadOnly;
|
|
204
|
+
}
|
|
205
|
+
set isReadOnly(value) {
|
|
206
|
+
this._isReadOnly = value;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Gets the transformed measure, that is the bounding box of the control after applying all transformations
|
|
210
|
+
*/
|
|
211
|
+
get transformedMeasure() {
|
|
212
|
+
return this._evaluatedMeasure;
|
|
213
|
+
}
|
|
214
|
+
/** Gets or sets a value indicating the offset to apply on X axis to render the shadow */
|
|
215
|
+
get shadowOffsetX() {
|
|
216
|
+
return this._shadowOffsetX;
|
|
217
|
+
}
|
|
218
|
+
set shadowOffsetX(value) {
|
|
219
|
+
if (this._shadowOffsetX === value) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
this._shadowOffsetX = value;
|
|
223
|
+
this._markAsDirty();
|
|
224
|
+
}
|
|
225
|
+
/** Gets or sets a value indicating the offset to apply on Y axis to render the shadow */
|
|
226
|
+
get shadowOffsetY() {
|
|
227
|
+
return this._shadowOffsetY;
|
|
228
|
+
}
|
|
229
|
+
set shadowOffsetY(value) {
|
|
230
|
+
if (this._shadowOffsetY === value) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
this._shadowOffsetY = value;
|
|
234
|
+
this._markAsDirty();
|
|
235
|
+
}
|
|
236
|
+
/** Gets or sets a value indicating the amount of blur to use to render the shadow */
|
|
237
|
+
get shadowBlur() {
|
|
238
|
+
return this._shadowBlur;
|
|
239
|
+
}
|
|
240
|
+
set shadowBlur(value) {
|
|
241
|
+
if (this._shadowBlur === value) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this._previousShadowBlur = this._shadowBlur;
|
|
245
|
+
this._shadowBlur = value;
|
|
246
|
+
this._markAsDirty();
|
|
247
|
+
}
|
|
248
|
+
/** Gets or sets a value indicating the color of the shadow (black by default ie. "#000") */
|
|
249
|
+
get shadowColor() {
|
|
250
|
+
return this._shadowColor;
|
|
251
|
+
}
|
|
252
|
+
set shadowColor(value) {
|
|
253
|
+
if (this._shadowColor === value) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
this._shadowColor = value;
|
|
257
|
+
this._markAsDirty();
|
|
258
|
+
}
|
|
259
|
+
// Properties
|
|
260
|
+
/** Gets the control type name */
|
|
261
|
+
get typeName() {
|
|
262
|
+
return this._getTypeName();
|
|
263
|
+
}
|
|
292
264
|
/**
|
|
293
265
|
* Get the current class name of the control.
|
|
294
266
|
* @returns current class name
|
|
295
267
|
*/
|
|
296
|
-
|
|
268
|
+
getClassName() {
|
|
297
269
|
return this._getTypeName();
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
return
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Get the hosting AdvancedDynamicTexture
|
|
273
|
+
*/
|
|
274
|
+
get host() {
|
|
275
|
+
return this._host;
|
|
276
|
+
}
|
|
277
|
+
/** Gets or set information about font offsets (used to render and align text) */
|
|
278
|
+
get fontOffset() {
|
|
279
|
+
return this._fontOffset;
|
|
280
|
+
}
|
|
281
|
+
set fontOffset(offset) {
|
|
282
|
+
this._fontOffset = offset;
|
|
283
|
+
}
|
|
284
|
+
/** Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent) */
|
|
285
|
+
get alpha() {
|
|
286
|
+
return this._alpha;
|
|
287
|
+
}
|
|
288
|
+
set alpha(value) {
|
|
289
|
+
if (this._alpha === value) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
this._alphaSet = true;
|
|
293
|
+
this._alpha = value;
|
|
294
|
+
this._markAsDirty();
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)
|
|
298
|
+
*/
|
|
299
|
+
get highlightLineWidth() {
|
|
300
|
+
return this._highlightLineWidth;
|
|
301
|
+
}
|
|
302
|
+
set highlightLineWidth(value) {
|
|
303
|
+
if (this._highlightLineWidth === value) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
this._highlightLineWidth = value;
|
|
307
|
+
this._markAsDirty();
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)
|
|
311
|
+
*/
|
|
312
|
+
get isHighlighted() {
|
|
313
|
+
return this._isHighlighted;
|
|
314
|
+
}
|
|
315
|
+
set isHighlighted(value) {
|
|
316
|
+
if (this._isHighlighted === value) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
this._isHighlighted = value;
|
|
320
|
+
this._markAsDirty();
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Gets or sets a string defining the color to use for highlighting this control
|
|
324
|
+
*/
|
|
325
|
+
get highlightColor() {
|
|
326
|
+
return this._highlightColor;
|
|
327
|
+
}
|
|
328
|
+
set highlightColor(value) {
|
|
329
|
+
if (this._highlightColor === value) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
this._highlightColor = value;
|
|
333
|
+
this._markAsDirty();
|
|
334
|
+
}
|
|
335
|
+
/** Gets or sets a value indicating the scale factor on X axis (1 by default)
|
|
336
|
+
* @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
|
|
337
|
+
*/
|
|
338
|
+
get scaleX() {
|
|
339
|
+
return this._scaleX;
|
|
340
|
+
}
|
|
341
|
+
set scaleX(value) {
|
|
342
|
+
if (this._scaleX === value) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
this._scaleX = value;
|
|
346
|
+
this._markAsDirty();
|
|
347
|
+
this._markMatrixAsDirty();
|
|
348
|
+
}
|
|
349
|
+
/** Gets or sets a value indicating the scale factor on Y axis (1 by default)
|
|
350
|
+
* @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
|
|
351
|
+
*/
|
|
352
|
+
get scaleY() {
|
|
353
|
+
return this._scaleY;
|
|
354
|
+
}
|
|
355
|
+
set scaleY(value) {
|
|
356
|
+
if (this._scaleY === value) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
this._scaleY = value;
|
|
360
|
+
this._markAsDirty();
|
|
361
|
+
this._markMatrixAsDirty();
|
|
362
|
+
}
|
|
363
|
+
/** Gets or sets the rotation angle (0 by default)
|
|
364
|
+
* @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
|
|
365
|
+
*/
|
|
366
|
+
get rotation() {
|
|
367
|
+
return this._rotation;
|
|
368
|
+
}
|
|
369
|
+
set rotation(value) {
|
|
370
|
+
if (this._rotation === value) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
this._rotation = value;
|
|
374
|
+
this._markAsDirty();
|
|
375
|
+
this._markMatrixAsDirty();
|
|
376
|
+
}
|
|
377
|
+
/** Gets or sets the transformation center on Y axis (0 by default)
|
|
378
|
+
* @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
|
|
379
|
+
*/
|
|
380
|
+
get transformCenterY() {
|
|
381
|
+
return this._transformCenterY;
|
|
382
|
+
}
|
|
383
|
+
set transformCenterY(value) {
|
|
384
|
+
if (this._transformCenterY === value) {
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
this._transformCenterY = value;
|
|
388
|
+
this._markAsDirty();
|
|
389
|
+
this._markMatrixAsDirty();
|
|
390
|
+
}
|
|
391
|
+
/** Gets or sets the transformation center on X axis (0 by default)
|
|
392
|
+
* @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
|
|
393
|
+
*/
|
|
394
|
+
get transformCenterX() {
|
|
395
|
+
return this._transformCenterX;
|
|
396
|
+
}
|
|
397
|
+
set transformCenterX(value) {
|
|
398
|
+
if (this._transformCenterX === value) {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
this._transformCenterX = value;
|
|
402
|
+
this._markAsDirty();
|
|
403
|
+
this._markMatrixAsDirty();
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Gets or sets the horizontal alignment
|
|
407
|
+
* @see https://doc.babylonjs.com/how_to/gui#alignments
|
|
408
|
+
*/
|
|
409
|
+
get horizontalAlignment() {
|
|
410
|
+
return this._horizontalAlignment;
|
|
411
|
+
}
|
|
412
|
+
set horizontalAlignment(value) {
|
|
413
|
+
if (this._horizontalAlignment === value) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
this._horizontalAlignment = value;
|
|
417
|
+
this._markAsDirty();
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Gets or sets the vertical alignment
|
|
421
|
+
* @see https://doc.babylonjs.com/how_to/gui#alignments
|
|
422
|
+
*/
|
|
423
|
+
get verticalAlignment() {
|
|
424
|
+
return this._verticalAlignment;
|
|
425
|
+
}
|
|
426
|
+
set verticalAlignment(value) {
|
|
427
|
+
if (this._verticalAlignment === value) {
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
this._verticalAlignment = value;
|
|
431
|
+
this._markAsDirty();
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Gets or sets control width
|
|
435
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
436
|
+
*/
|
|
437
|
+
get width() {
|
|
438
|
+
return this._width.toString(this._host);
|
|
439
|
+
}
|
|
440
|
+
set width(value) {
|
|
441
|
+
this._fixedRatioMasterIsWidth = true;
|
|
442
|
+
if (this._width.toString(this._host) === value) {
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
if (this._width.fromString(value)) {
|
|
417
446
|
this._markAsDirty();
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Gets or sets the control width in pixel
|
|
451
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
452
|
+
*/
|
|
453
|
+
get widthInPixels() {
|
|
454
|
+
return this._width.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
455
|
+
}
|
|
456
|
+
set widthInPixels(value) {
|
|
457
|
+
if (isNaN(value)) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
this._fixedRatioMasterIsWidth = true;
|
|
461
|
+
this.width = value + "px";
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Gets or sets control height
|
|
465
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
466
|
+
*/
|
|
467
|
+
get height() {
|
|
468
|
+
return this._height.toString(this._host);
|
|
469
|
+
}
|
|
470
|
+
set height(value) {
|
|
471
|
+
this._fixedRatioMasterIsWidth = false;
|
|
472
|
+
if (this._height.toString(this._host) === value) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
if (this._height.fromString(value)) {
|
|
435
476
|
this._markAsDirty();
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Gets or sets control height in pixel
|
|
481
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
482
|
+
*/
|
|
483
|
+
get heightInPixels() {
|
|
484
|
+
return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
485
|
+
}
|
|
486
|
+
set heightInPixels(value) {
|
|
487
|
+
if (isNaN(value)) {
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
this._fixedRatioMasterIsWidth = false;
|
|
491
|
+
this.height = value + "px";
|
|
492
|
+
}
|
|
493
|
+
/** Gets or set font family */
|
|
494
|
+
get fontFamily() {
|
|
495
|
+
return this._fontFamily;
|
|
496
|
+
}
|
|
497
|
+
set fontFamily(value) {
|
|
498
|
+
if (this._fontFamily === value) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
this._fontFamily = value;
|
|
502
|
+
this._resetFontCache();
|
|
503
|
+
}
|
|
504
|
+
/** Gets or sets font style */
|
|
505
|
+
get fontStyle() {
|
|
506
|
+
return this._fontStyle;
|
|
507
|
+
}
|
|
508
|
+
set fontStyle(value) {
|
|
509
|
+
if (this._fontStyle === value) {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
this._fontStyle = value;
|
|
513
|
+
this._resetFontCache();
|
|
514
|
+
}
|
|
515
|
+
/** Gets or sets font weight */
|
|
516
|
+
get fontWeight() {
|
|
517
|
+
return this._fontWeight;
|
|
518
|
+
}
|
|
519
|
+
set fontWeight(value) {
|
|
520
|
+
if (this._fontWeight === value) {
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
this._fontWeight = value;
|
|
524
|
+
this._resetFontCache();
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Gets or sets style
|
|
528
|
+
* @see https://doc.babylonjs.com/how_to/gui#styles
|
|
529
|
+
*/
|
|
530
|
+
get style() {
|
|
531
|
+
return this._style;
|
|
532
|
+
}
|
|
533
|
+
set style(value) {
|
|
534
|
+
if (this._style) {
|
|
535
|
+
this._style.onChangedObservable.remove(this._styleObserver);
|
|
536
|
+
this._styleObserver = null;
|
|
537
|
+
}
|
|
538
|
+
this._style = value;
|
|
539
|
+
if (this._style) {
|
|
540
|
+
this._styleObserver = this._style.onChangedObservable.add(() => {
|
|
541
|
+
this._markAsDirty();
|
|
542
|
+
this._resetFontCache();
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
this._markAsDirty();
|
|
546
|
+
this._resetFontCache();
|
|
547
|
+
}
|
|
548
|
+
/** @hidden */
|
|
549
|
+
get _isFontSizeInPercentage() {
|
|
550
|
+
return this._fontSize.isPercentage;
|
|
551
|
+
}
|
|
552
|
+
/** Gets or sets font size in pixels */
|
|
553
|
+
get fontSizeInPixels() {
|
|
554
|
+
const fontSizeToUse = this._style ? this._style._fontSize : this._fontSize;
|
|
555
|
+
if (fontSizeToUse.isPixel) {
|
|
556
|
+
return fontSizeToUse.getValue(this._host);
|
|
557
|
+
}
|
|
558
|
+
return fontSizeToUse.getValueInPixel(this._host, this._tempParentMeasure.height || this._cachedParentMeasure.height);
|
|
559
|
+
}
|
|
560
|
+
set fontSizeInPixels(value) {
|
|
561
|
+
if (isNaN(value)) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
this.fontSize = value + "px";
|
|
565
|
+
}
|
|
566
|
+
/** Gets or sets font size */
|
|
567
|
+
get fontSize() {
|
|
568
|
+
return this._fontSize.toString(this._host);
|
|
569
|
+
}
|
|
570
|
+
set fontSize(value) {
|
|
571
|
+
if (this._fontSize.toString(this._host) === value) {
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
if (this._fontSize.fromString(value)) {
|
|
453
575
|
this._markAsDirty();
|
|
454
|
-
this.
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
576
|
+
this._resetFontCache();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
/** Gets or sets foreground color */
|
|
580
|
+
get color() {
|
|
581
|
+
return this._color;
|
|
582
|
+
}
|
|
583
|
+
set color(value) {
|
|
584
|
+
if (this._color === value) {
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
this._color = value;
|
|
588
|
+
this._markAsDirty();
|
|
589
|
+
}
|
|
590
|
+
/** Gets or sets z index which is used to reorder controls on the z axis */
|
|
591
|
+
get zIndex() {
|
|
592
|
+
return this._zIndex;
|
|
593
|
+
}
|
|
594
|
+
set zIndex(value) {
|
|
595
|
+
if (this.zIndex === value) {
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
this._zIndex = value;
|
|
599
|
+
if (this.parent) {
|
|
600
|
+
this.parent._reOrderControl(this);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
/** Gets or sets a boolean indicating if the control can be rendered */
|
|
604
|
+
get notRenderable() {
|
|
605
|
+
return this._doNotRender;
|
|
606
|
+
}
|
|
607
|
+
set notRenderable(value) {
|
|
608
|
+
if (this._doNotRender === value) {
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
this._doNotRender = value;
|
|
612
|
+
this._markAsDirty();
|
|
613
|
+
}
|
|
614
|
+
/** Gets or sets a boolean indicating if the control is visible */
|
|
615
|
+
get isVisible() {
|
|
616
|
+
return this._isVisible;
|
|
617
|
+
}
|
|
618
|
+
set isVisible(value) {
|
|
619
|
+
if (this._isVisible === value) {
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
this._isVisible = value;
|
|
623
|
+
this._markAsDirty(true);
|
|
624
|
+
}
|
|
625
|
+
/** Gets a boolean indicating that the control needs to update its rendering */
|
|
626
|
+
get isDirty() {
|
|
627
|
+
return this._isDirty;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Gets the current linked mesh (or null if none)
|
|
631
|
+
*/
|
|
632
|
+
get linkedMesh() {
|
|
633
|
+
return this._linkedMesh;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Gets or sets a value indicating the padding should work like in CSS.
|
|
637
|
+
* Basically, it will add the padding amount on each side of the parent control for its children.
|
|
638
|
+
*/
|
|
639
|
+
get descendantsOnlyPadding() {
|
|
640
|
+
return this._descendantsOnlyPadding;
|
|
641
|
+
}
|
|
642
|
+
set descendantsOnlyPadding(value) {
|
|
643
|
+
if (this._descendantsOnlyPadding === value) {
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
this._descendantsOnlyPadding = value;
|
|
647
|
+
this._markAsDirty();
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Gets or sets a value indicating the padding to use on the left of the control
|
|
651
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
652
|
+
*/
|
|
653
|
+
get paddingLeft() {
|
|
654
|
+
return this._paddingLeft.toString(this._host);
|
|
655
|
+
}
|
|
656
|
+
set paddingLeft(value) {
|
|
657
|
+
if (this._paddingLeft.fromString(value)) {
|
|
471
658
|
this._markAsDirty();
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
return
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Gets or sets a value indicating the padding in pixels to use on the left of the control
|
|
663
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
664
|
+
*/
|
|
665
|
+
get paddingLeftInPixels() {
|
|
666
|
+
return this._paddingLeft.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
667
|
+
}
|
|
668
|
+
set paddingLeftInPixels(value) {
|
|
669
|
+
if (isNaN(value)) {
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
this.paddingLeft = value + "px";
|
|
673
|
+
}
|
|
674
|
+
/** @hidden */
|
|
675
|
+
get _paddingLeftInPixels() {
|
|
676
|
+
if (this._descendantsOnlyPadding) {
|
|
677
|
+
return 0;
|
|
678
|
+
}
|
|
679
|
+
return this.paddingLeftInPixels;
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Gets or sets a value indicating the padding to use on the right of the control
|
|
683
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
684
|
+
*/
|
|
685
|
+
get paddingRight() {
|
|
686
|
+
return this._paddingRight.toString(this._host);
|
|
687
|
+
}
|
|
688
|
+
set paddingRight(value) {
|
|
689
|
+
if (this._paddingRight.fromString(value)) {
|
|
490
690
|
this._markAsDirty();
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Gets or sets a value indicating the padding in pixels to use on the right of the control
|
|
695
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
696
|
+
*/
|
|
697
|
+
get paddingRightInPixels() {
|
|
698
|
+
return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
699
|
+
}
|
|
700
|
+
set paddingRightInPixels(value) {
|
|
701
|
+
if (isNaN(value)) {
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
this.paddingRight = value + "px";
|
|
705
|
+
}
|
|
706
|
+
/** @hidden */
|
|
707
|
+
get _paddingRightInPixels() {
|
|
708
|
+
if (this._descendantsOnlyPadding) {
|
|
709
|
+
return 0;
|
|
710
|
+
}
|
|
711
|
+
return this.paddingRightInPixels;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Gets or sets a value indicating the padding to use on the top of the control
|
|
715
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
716
|
+
*/
|
|
717
|
+
get paddingTop() {
|
|
718
|
+
return this._paddingTop.toString(this._host);
|
|
719
|
+
}
|
|
720
|
+
set paddingTop(value) {
|
|
721
|
+
if (this._paddingTop.fromString(value)) {
|
|
508
722
|
this._markAsDirty();
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
},
|
|
541
|
-
set: function (value) {
|
|
542
|
-
if (isNaN(value)) {
|
|
543
|
-
return;
|
|
544
|
-
}
|
|
545
|
-
this._fixedRatioMasterIsWidth = true;
|
|
546
|
-
this.width = value + "px";
|
|
547
|
-
},
|
|
548
|
-
enumerable: false,
|
|
549
|
-
configurable: true
|
|
550
|
-
});
|
|
551
|
-
Object.defineProperty(Control.prototype, "height", {
|
|
552
|
-
/**
|
|
553
|
-
* Gets or sets control height
|
|
554
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
555
|
-
*/
|
|
556
|
-
get: function () {
|
|
557
|
-
return this._height.toString(this._host);
|
|
558
|
-
},
|
|
559
|
-
set: function (value) {
|
|
560
|
-
this._fixedRatioMasterIsWidth = false;
|
|
561
|
-
if (this._height.toString(this._host) === value) {
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
if (this._height.fromString(value)) {
|
|
565
|
-
this._markAsDirty();
|
|
566
|
-
}
|
|
567
|
-
},
|
|
568
|
-
enumerable: false,
|
|
569
|
-
configurable: true
|
|
570
|
-
});
|
|
571
|
-
Object.defineProperty(Control.prototype, "heightInPixels", {
|
|
572
|
-
/**
|
|
573
|
-
* Gets or sets control height in pixel
|
|
574
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
575
|
-
*/
|
|
576
|
-
get: function () {
|
|
577
|
-
return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
578
|
-
},
|
|
579
|
-
set: function (value) {
|
|
580
|
-
if (isNaN(value)) {
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
this._fixedRatioMasterIsWidth = false;
|
|
584
|
-
this.height = value + "px";
|
|
585
|
-
},
|
|
586
|
-
enumerable: false,
|
|
587
|
-
configurable: true
|
|
588
|
-
});
|
|
589
|
-
Object.defineProperty(Control.prototype, "fontFamily", {
|
|
590
|
-
/** Gets or set font family */
|
|
591
|
-
get: function () {
|
|
592
|
-
return this._fontFamily;
|
|
593
|
-
},
|
|
594
|
-
set: function (value) {
|
|
595
|
-
if (this._fontFamily === value) {
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
this._fontFamily = value;
|
|
599
|
-
this._resetFontCache();
|
|
600
|
-
},
|
|
601
|
-
enumerable: false,
|
|
602
|
-
configurable: true
|
|
603
|
-
});
|
|
604
|
-
Object.defineProperty(Control.prototype, "fontStyle", {
|
|
605
|
-
/** Gets or sets font style */
|
|
606
|
-
get: function () {
|
|
607
|
-
return this._fontStyle;
|
|
608
|
-
},
|
|
609
|
-
set: function (value) {
|
|
610
|
-
if (this._fontStyle === value) {
|
|
611
|
-
return;
|
|
612
|
-
}
|
|
613
|
-
this._fontStyle = value;
|
|
614
|
-
this._resetFontCache();
|
|
615
|
-
},
|
|
616
|
-
enumerable: false,
|
|
617
|
-
configurable: true
|
|
618
|
-
});
|
|
619
|
-
Object.defineProperty(Control.prototype, "fontWeight", {
|
|
620
|
-
/** Gets or sets font weight */
|
|
621
|
-
get: function () {
|
|
622
|
-
return this._fontWeight;
|
|
623
|
-
},
|
|
624
|
-
set: function (value) {
|
|
625
|
-
if (this._fontWeight === value) {
|
|
626
|
-
return;
|
|
627
|
-
}
|
|
628
|
-
this._fontWeight = value;
|
|
629
|
-
this._resetFontCache();
|
|
630
|
-
},
|
|
631
|
-
enumerable: false,
|
|
632
|
-
configurable: true
|
|
633
|
-
});
|
|
634
|
-
Object.defineProperty(Control.prototype, "style", {
|
|
635
|
-
/**
|
|
636
|
-
* Gets or sets style
|
|
637
|
-
* @see https://doc.babylonjs.com/how_to/gui#styles
|
|
638
|
-
*/
|
|
639
|
-
get: function () {
|
|
640
|
-
return this._style;
|
|
641
|
-
},
|
|
642
|
-
set: function (value) {
|
|
643
|
-
var _this = this;
|
|
644
|
-
if (this._style) {
|
|
645
|
-
this._style.onChangedObservable.remove(this._styleObserver);
|
|
646
|
-
this._styleObserver = null;
|
|
647
|
-
}
|
|
648
|
-
this._style = value;
|
|
649
|
-
if (this._style) {
|
|
650
|
-
this._styleObserver = this._style.onChangedObservable.add(function () {
|
|
651
|
-
_this._markAsDirty();
|
|
652
|
-
_this._resetFontCache();
|
|
653
|
-
});
|
|
654
|
-
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Gets or sets a value indicating the padding in pixels to use on the top of the control
|
|
727
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
728
|
+
*/
|
|
729
|
+
get paddingTopInPixels() {
|
|
730
|
+
return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
731
|
+
}
|
|
732
|
+
set paddingTopInPixels(value) {
|
|
733
|
+
if (isNaN(value)) {
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
this.paddingTop = value + "px";
|
|
737
|
+
}
|
|
738
|
+
/** @hidden */
|
|
739
|
+
get _paddingTopInPixels() {
|
|
740
|
+
if (this._descendantsOnlyPadding) {
|
|
741
|
+
return 0;
|
|
742
|
+
}
|
|
743
|
+
return this.paddingTopInPixels;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Gets or sets a value indicating the padding to use on the bottom of the control
|
|
747
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
748
|
+
*/
|
|
749
|
+
get paddingBottom() {
|
|
750
|
+
return this._paddingBottom.toString(this._host);
|
|
751
|
+
}
|
|
752
|
+
set paddingBottom(value) {
|
|
753
|
+
if (this._paddingBottom.fromString(value)) {
|
|
655
754
|
this._markAsDirty();
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
Object.defineProperty(Control.prototype, "fontSize", {
|
|
688
|
-
/** Gets or sets font size */
|
|
689
|
-
get: function () {
|
|
690
|
-
return this._fontSize.toString(this._host);
|
|
691
|
-
},
|
|
692
|
-
set: function (value) {
|
|
693
|
-
if (this._fontSize.toString(this._host) === value) {
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
if (this._fontSize.fromString(value)) {
|
|
697
|
-
this._markAsDirty();
|
|
698
|
-
this._resetFontCache();
|
|
699
|
-
}
|
|
700
|
-
},
|
|
701
|
-
enumerable: false,
|
|
702
|
-
configurable: true
|
|
703
|
-
});
|
|
704
|
-
Object.defineProperty(Control.prototype, "color", {
|
|
705
|
-
/** Gets or sets foreground color */
|
|
706
|
-
get: function () {
|
|
707
|
-
return this._color;
|
|
708
|
-
},
|
|
709
|
-
set: function (value) {
|
|
710
|
-
if (this._color === value) {
|
|
711
|
-
return;
|
|
712
|
-
}
|
|
713
|
-
this._color = value;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Gets or sets a value indicating the padding in pixels to use on the bottom of the control
|
|
759
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
760
|
+
*/
|
|
761
|
+
get paddingBottomInPixels() {
|
|
762
|
+
return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
763
|
+
}
|
|
764
|
+
set paddingBottomInPixels(value) {
|
|
765
|
+
if (isNaN(value)) {
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
this.paddingBottom = value + "px";
|
|
769
|
+
}
|
|
770
|
+
/** @hidden */
|
|
771
|
+
get _paddingBottomInPixels() {
|
|
772
|
+
if (this._descendantsOnlyPadding) {
|
|
773
|
+
return 0;
|
|
774
|
+
}
|
|
775
|
+
return this.paddingBottomInPixels;
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Gets or sets a value indicating the left coordinate of the control
|
|
779
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
780
|
+
*/
|
|
781
|
+
get left() {
|
|
782
|
+
return this._left.toString(this._host);
|
|
783
|
+
}
|
|
784
|
+
set left(value) {
|
|
785
|
+
if (this._left.fromString(value)) {
|
|
714
786
|
this._markAsDirty();
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
return this._doNotRender;
|
|
740
|
-
},
|
|
741
|
-
set: function (value) {
|
|
742
|
-
if (this._doNotRender === value) {
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
this._doNotRender = value;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Gets or sets a value indicating the left coordinate in pixels of the control
|
|
791
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
792
|
+
*/
|
|
793
|
+
get leftInPixels() {
|
|
794
|
+
return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
795
|
+
}
|
|
796
|
+
set leftInPixels(value) {
|
|
797
|
+
if (isNaN(value)) {
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
this.left = value + "px";
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* Gets or sets a value indicating the top coordinate of the control
|
|
804
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
805
|
+
*/
|
|
806
|
+
get top() {
|
|
807
|
+
return this._top.toString(this._host);
|
|
808
|
+
}
|
|
809
|
+
set top(value) {
|
|
810
|
+
if (this._top.fromString(value)) {
|
|
746
811
|
this._markAsDirty();
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
enumerable: false,
|
|
772
|
-
configurable: true
|
|
773
|
-
});
|
|
774
|
-
Object.defineProperty(Control.prototype, "linkedMesh", {
|
|
775
|
-
/**
|
|
776
|
-
* Gets the current linked mesh (or null if none)
|
|
777
|
-
*/
|
|
778
|
-
get: function () {
|
|
779
|
-
return this._linkedMesh;
|
|
780
|
-
},
|
|
781
|
-
enumerable: false,
|
|
782
|
-
configurable: true
|
|
783
|
-
});
|
|
784
|
-
Object.defineProperty(Control.prototype, "descendantsOnlyPadding", {
|
|
785
|
-
/**
|
|
786
|
-
* Gets or sets a value indicating the padding should work like in CSS.
|
|
787
|
-
* Basically, it will add the padding amount on each side of the parent control for its children.
|
|
788
|
-
*/
|
|
789
|
-
get: function () {
|
|
790
|
-
return this._descendantsOnlyPadding;
|
|
791
|
-
},
|
|
792
|
-
set: function (value) {
|
|
793
|
-
if (this._descendantsOnlyPadding === value) {
|
|
794
|
-
return;
|
|
795
|
-
}
|
|
796
|
-
this._descendantsOnlyPadding = value;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Gets or sets a value indicating the top coordinate in pixels of the control
|
|
816
|
+
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
817
|
+
*/
|
|
818
|
+
get topInPixels() {
|
|
819
|
+
return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
820
|
+
}
|
|
821
|
+
set topInPixels(value) {
|
|
822
|
+
if (isNaN(value)) {
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
this.top = value + "px";
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* Gets or sets a value indicating the offset on X axis to the linked mesh
|
|
829
|
+
* @see https://doc.babylonjs.com/how_to/gui#tracking-positions
|
|
830
|
+
*/
|
|
831
|
+
get linkOffsetX() {
|
|
832
|
+
return this._linkOffsetX.toString(this._host);
|
|
833
|
+
}
|
|
834
|
+
set linkOffsetX(value) {
|
|
835
|
+
if (this._linkOffsetX.fromString(value)) {
|
|
797
836
|
this._markAsDirty();
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
return
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
enumerable: false,
|
|
860
|
-
configurable: true
|
|
861
|
-
});
|
|
862
|
-
Object.defineProperty(Control.prototype, "paddingRightInPixels", {
|
|
863
|
-
/**
|
|
864
|
-
* Gets or sets a value indicating the padding in pixels to use on the right of the control
|
|
865
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
866
|
-
*/
|
|
867
|
-
get: function () {
|
|
868
|
-
return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
869
|
-
},
|
|
870
|
-
set: function (value) {
|
|
871
|
-
if (isNaN(value)) {
|
|
872
|
-
return;
|
|
873
|
-
}
|
|
874
|
-
this.paddingRight = value + "px";
|
|
875
|
-
},
|
|
876
|
-
enumerable: false,
|
|
877
|
-
configurable: true
|
|
878
|
-
});
|
|
879
|
-
Object.defineProperty(Control.prototype, "_paddingRightInPixels", {
|
|
880
|
-
/** @hidden */
|
|
881
|
-
get: function () {
|
|
882
|
-
if (this._descendantsOnlyPadding) {
|
|
883
|
-
return 0;
|
|
884
|
-
}
|
|
885
|
-
return this.paddingRightInPixels;
|
|
886
|
-
},
|
|
887
|
-
enumerable: false,
|
|
888
|
-
configurable: true
|
|
889
|
-
});
|
|
890
|
-
Object.defineProperty(Control.prototype, "paddingTop", {
|
|
891
|
-
/**
|
|
892
|
-
* Gets or sets a value indicating the padding to use on the top of the control
|
|
893
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
894
|
-
*/
|
|
895
|
-
get: function () {
|
|
896
|
-
return this._paddingTop.toString(this._host);
|
|
897
|
-
},
|
|
898
|
-
set: function (value) {
|
|
899
|
-
if (this._paddingTop.fromString(value)) {
|
|
900
|
-
this._markAsDirty();
|
|
901
|
-
}
|
|
902
|
-
},
|
|
903
|
-
enumerable: false,
|
|
904
|
-
configurable: true
|
|
905
|
-
});
|
|
906
|
-
Object.defineProperty(Control.prototype, "paddingTopInPixels", {
|
|
907
|
-
/**
|
|
908
|
-
* Gets or sets a value indicating the padding in pixels to use on the top of the control
|
|
909
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
910
|
-
*/
|
|
911
|
-
get: function () {
|
|
912
|
-
return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
913
|
-
},
|
|
914
|
-
set: function (value) {
|
|
915
|
-
if (isNaN(value)) {
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
this.paddingTop = value + "px";
|
|
919
|
-
},
|
|
920
|
-
enumerable: false,
|
|
921
|
-
configurable: true
|
|
922
|
-
});
|
|
923
|
-
Object.defineProperty(Control.prototype, "_paddingTopInPixels", {
|
|
924
|
-
/** @hidden */
|
|
925
|
-
get: function () {
|
|
926
|
-
if (this._descendantsOnlyPadding) {
|
|
927
|
-
return 0;
|
|
928
|
-
}
|
|
929
|
-
return this.paddingTopInPixels;
|
|
930
|
-
},
|
|
931
|
-
enumerable: false,
|
|
932
|
-
configurable: true
|
|
933
|
-
});
|
|
934
|
-
Object.defineProperty(Control.prototype, "paddingBottom", {
|
|
935
|
-
/**
|
|
936
|
-
* Gets or sets a value indicating the padding to use on the bottom of the control
|
|
937
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
938
|
-
*/
|
|
939
|
-
get: function () {
|
|
940
|
-
return this._paddingBottom.toString(this._host);
|
|
941
|
-
},
|
|
942
|
-
set: function (value) {
|
|
943
|
-
if (this._paddingBottom.fromString(value)) {
|
|
944
|
-
this._markAsDirty();
|
|
945
|
-
}
|
|
946
|
-
},
|
|
947
|
-
enumerable: false,
|
|
948
|
-
configurable: true
|
|
949
|
-
});
|
|
950
|
-
Object.defineProperty(Control.prototype, "paddingBottomInPixels", {
|
|
951
|
-
/**
|
|
952
|
-
* Gets or sets a value indicating the padding in pixels to use on the bottom of the control
|
|
953
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
954
|
-
*/
|
|
955
|
-
get: function () {
|
|
956
|
-
return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
957
|
-
},
|
|
958
|
-
set: function (value) {
|
|
959
|
-
if (isNaN(value)) {
|
|
960
|
-
return;
|
|
961
|
-
}
|
|
962
|
-
this.paddingBottom = value + "px";
|
|
963
|
-
},
|
|
964
|
-
enumerable: false,
|
|
965
|
-
configurable: true
|
|
966
|
-
});
|
|
967
|
-
Object.defineProperty(Control.prototype, "_paddingBottomInPixels", {
|
|
968
|
-
/** @hidden */
|
|
969
|
-
get: function () {
|
|
970
|
-
if (this._descendantsOnlyPadding) {
|
|
971
|
-
return 0;
|
|
972
|
-
}
|
|
973
|
-
return this.paddingBottomInPixels;
|
|
974
|
-
},
|
|
975
|
-
enumerable: false,
|
|
976
|
-
configurable: true
|
|
977
|
-
});
|
|
978
|
-
Object.defineProperty(Control.prototype, "left", {
|
|
979
|
-
/**
|
|
980
|
-
* Gets or sets a value indicating the left coordinate of the control
|
|
981
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
982
|
-
*/
|
|
983
|
-
get: function () {
|
|
984
|
-
return this._left.toString(this._host);
|
|
985
|
-
},
|
|
986
|
-
set: function (value) {
|
|
987
|
-
if (this._left.fromString(value)) {
|
|
988
|
-
this._markAsDirty();
|
|
989
|
-
}
|
|
990
|
-
},
|
|
991
|
-
enumerable: false,
|
|
992
|
-
configurable: true
|
|
993
|
-
});
|
|
994
|
-
Object.defineProperty(Control.prototype, "leftInPixels", {
|
|
995
|
-
/**
|
|
996
|
-
* Gets or sets a value indicating the left coordinate in pixels of the control
|
|
997
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
998
|
-
*/
|
|
999
|
-
get: function () {
|
|
1000
|
-
return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
1001
|
-
},
|
|
1002
|
-
set: function (value) {
|
|
1003
|
-
if (isNaN(value)) {
|
|
1004
|
-
return;
|
|
1005
|
-
}
|
|
1006
|
-
this.left = value + "px";
|
|
1007
|
-
},
|
|
1008
|
-
enumerable: false,
|
|
1009
|
-
configurable: true
|
|
1010
|
-
});
|
|
1011
|
-
Object.defineProperty(Control.prototype, "top", {
|
|
1012
|
-
/**
|
|
1013
|
-
* Gets or sets a value indicating the top coordinate of the control
|
|
1014
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
1015
|
-
*/
|
|
1016
|
-
get: function () {
|
|
1017
|
-
return this._top.toString(this._host);
|
|
1018
|
-
},
|
|
1019
|
-
set: function (value) {
|
|
1020
|
-
if (this._top.fromString(value)) {
|
|
1021
|
-
this._markAsDirty();
|
|
1022
|
-
}
|
|
1023
|
-
},
|
|
1024
|
-
enumerable: false,
|
|
1025
|
-
configurable: true
|
|
1026
|
-
});
|
|
1027
|
-
Object.defineProperty(Control.prototype, "topInPixels", {
|
|
1028
|
-
/**
|
|
1029
|
-
* Gets or sets a value indicating the top coordinate in pixels of the control
|
|
1030
|
-
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
1031
|
-
*/
|
|
1032
|
-
get: function () {
|
|
1033
|
-
return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
1034
|
-
},
|
|
1035
|
-
set: function (value) {
|
|
1036
|
-
if (isNaN(value)) {
|
|
1037
|
-
return;
|
|
1038
|
-
}
|
|
1039
|
-
this.top = value + "px";
|
|
1040
|
-
},
|
|
1041
|
-
enumerable: false,
|
|
1042
|
-
configurable: true
|
|
1043
|
-
});
|
|
1044
|
-
Object.defineProperty(Control.prototype, "linkOffsetX", {
|
|
1045
|
-
/**
|
|
1046
|
-
* Gets or sets a value indicating the offset on X axis to the linked mesh
|
|
1047
|
-
* @see https://doc.babylonjs.com/how_to/gui#tracking-positions
|
|
1048
|
-
*/
|
|
1049
|
-
get: function () {
|
|
1050
|
-
return this._linkOffsetX.toString(this._host);
|
|
1051
|
-
},
|
|
1052
|
-
set: function (value) {
|
|
1053
|
-
if (this._linkOffsetX.fromString(value)) {
|
|
1054
|
-
this._markAsDirty();
|
|
1055
|
-
}
|
|
1056
|
-
},
|
|
1057
|
-
enumerable: false,
|
|
1058
|
-
configurable: true
|
|
1059
|
-
});
|
|
1060
|
-
Object.defineProperty(Control.prototype, "linkOffsetXInPixels", {
|
|
1061
|
-
/**
|
|
1062
|
-
* Gets or sets a value indicating the offset in pixels on X axis to the linked mesh
|
|
1063
|
-
* @see https://doc.babylonjs.com/how_to/gui#tracking-positions
|
|
1064
|
-
*/
|
|
1065
|
-
get: function () {
|
|
1066
|
-
return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
1067
|
-
},
|
|
1068
|
-
set: function (value) {
|
|
1069
|
-
if (isNaN(value)) {
|
|
1070
|
-
return;
|
|
1071
|
-
}
|
|
1072
|
-
this.linkOffsetX = value + "px";
|
|
1073
|
-
},
|
|
1074
|
-
enumerable: false,
|
|
1075
|
-
configurable: true
|
|
1076
|
-
});
|
|
1077
|
-
Object.defineProperty(Control.prototype, "linkOffsetY", {
|
|
1078
|
-
/**
|
|
1079
|
-
* Gets or sets a value indicating the offset on Y axis to the linked mesh
|
|
1080
|
-
* @see https://doc.babylonjs.com/how_to/gui#tracking-positions
|
|
1081
|
-
*/
|
|
1082
|
-
get: function () {
|
|
1083
|
-
return this._linkOffsetY.toString(this._host);
|
|
1084
|
-
},
|
|
1085
|
-
set: function (value) {
|
|
1086
|
-
if (this._linkOffsetY.fromString(value)) {
|
|
1087
|
-
this._markAsDirty();
|
|
1088
|
-
}
|
|
1089
|
-
},
|
|
1090
|
-
enumerable: false,
|
|
1091
|
-
configurable: true
|
|
1092
|
-
});
|
|
1093
|
-
Object.defineProperty(Control.prototype, "linkOffsetYInPixels", {
|
|
1094
|
-
/**
|
|
1095
|
-
* Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh
|
|
1096
|
-
* @see https://doc.babylonjs.com/how_to/gui#tracking-positions
|
|
1097
|
-
*/
|
|
1098
|
-
get: function () {
|
|
1099
|
-
return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
1100
|
-
},
|
|
1101
|
-
set: function (value) {
|
|
1102
|
-
if (isNaN(value)) {
|
|
1103
|
-
return;
|
|
1104
|
-
}
|
|
1105
|
-
this.linkOffsetY = value + "px";
|
|
1106
|
-
},
|
|
1107
|
-
enumerable: false,
|
|
1108
|
-
configurable: true
|
|
1109
|
-
});
|
|
1110
|
-
Object.defineProperty(Control.prototype, "centerX", {
|
|
1111
|
-
/** Gets the center coordinate on X axis */
|
|
1112
|
-
get: function () {
|
|
1113
|
-
return this._currentMeasure.left + this._currentMeasure.width / 2;
|
|
1114
|
-
},
|
|
1115
|
-
enumerable: false,
|
|
1116
|
-
configurable: true
|
|
1117
|
-
});
|
|
1118
|
-
Object.defineProperty(Control.prototype, "centerY", {
|
|
1119
|
-
/** Gets the center coordinate on Y axis */
|
|
1120
|
-
get: function () {
|
|
1121
|
-
return this._currentMeasure.top + this._currentMeasure.height / 2;
|
|
1122
|
-
},
|
|
1123
|
-
enumerable: false,
|
|
1124
|
-
configurable: true
|
|
1125
|
-
});
|
|
1126
|
-
Object.defineProperty(Control.prototype, "isEnabled", {
|
|
1127
|
-
/** Gets or sets if control is Enabled */
|
|
1128
|
-
get: function () {
|
|
1129
|
-
return this._isEnabled;
|
|
1130
|
-
},
|
|
1131
|
-
set: function (value) {
|
|
1132
|
-
var _this = this;
|
|
1133
|
-
if (this._isEnabled === value) {
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Gets or sets a value indicating the offset in pixels on X axis to the linked mesh
|
|
841
|
+
* @see https://doc.babylonjs.com/how_to/gui#tracking-positions
|
|
842
|
+
*/
|
|
843
|
+
get linkOffsetXInPixels() {
|
|
844
|
+
return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width);
|
|
845
|
+
}
|
|
846
|
+
set linkOffsetXInPixels(value) {
|
|
847
|
+
if (isNaN(value)) {
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
this.linkOffsetX = value + "px";
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Gets or sets a value indicating the offset on Y axis to the linked mesh
|
|
854
|
+
* @see https://doc.babylonjs.com/how_to/gui#tracking-positions
|
|
855
|
+
*/
|
|
856
|
+
get linkOffsetY() {
|
|
857
|
+
return this._linkOffsetY.toString(this._host);
|
|
858
|
+
}
|
|
859
|
+
set linkOffsetY(value) {
|
|
860
|
+
if (this._linkOffsetY.fromString(value)) {
|
|
861
|
+
this._markAsDirty();
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh
|
|
866
|
+
* @see https://doc.babylonjs.com/how_to/gui#tracking-positions
|
|
867
|
+
*/
|
|
868
|
+
get linkOffsetYInPixels() {
|
|
869
|
+
return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height);
|
|
870
|
+
}
|
|
871
|
+
set linkOffsetYInPixels(value) {
|
|
872
|
+
if (isNaN(value)) {
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
875
|
+
this.linkOffsetY = value + "px";
|
|
876
|
+
}
|
|
877
|
+
/** Gets the center coordinate on X axis */
|
|
878
|
+
get centerX() {
|
|
879
|
+
return this._currentMeasure.left + this._currentMeasure.width / 2;
|
|
880
|
+
}
|
|
881
|
+
/** Gets the center coordinate on Y axis */
|
|
882
|
+
get centerY() {
|
|
883
|
+
return this._currentMeasure.top + this._currentMeasure.height / 2;
|
|
884
|
+
}
|
|
885
|
+
/** Gets or sets if control is Enabled */
|
|
886
|
+
get isEnabled() {
|
|
887
|
+
return this._isEnabled;
|
|
888
|
+
}
|
|
889
|
+
set isEnabled(value) {
|
|
890
|
+
if (this._isEnabled === value) {
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
this._isEnabled = value;
|
|
894
|
+
this._markAsDirty();
|
|
895
|
+
// if this control or any of it's descendants are under a pointer, we need to fire a pointerOut event
|
|
896
|
+
const recursivelyFirePointerOut = (control) => {
|
|
897
|
+
if (!control.host) {
|
|
1134
898
|
return;
|
|
1135
899
|
}
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
if (!control.host) {
|
|
1141
|
-
return;
|
|
900
|
+
for (const pointer in control.host._lastControlOver) {
|
|
901
|
+
if (control === this.host._lastControlOver[pointer]) {
|
|
902
|
+
control._onPointerOut(control, null, true);
|
|
903
|
+
delete control.host._lastControlOver[pointer];
|
|
1142
904
|
}
|
|
1143
|
-
for (var pointer in control.host._lastControlOver) {
|
|
1144
|
-
if (control === _this.host._lastControlOver[pointer]) {
|
|
1145
|
-
control._onPointerOut(control, null, true);
|
|
1146
|
-
delete control.host._lastControlOver[pointer];
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
if (control.children !== undefined) {
|
|
1150
|
-
control.children.forEach(recursivelyFirePointerOut);
|
|
1151
|
-
}
|
|
1152
|
-
};
|
|
1153
|
-
recursivelyFirePointerOut(this);
|
|
1154
|
-
},
|
|
1155
|
-
enumerable: false,
|
|
1156
|
-
configurable: true
|
|
1157
|
-
});
|
|
1158
|
-
Object.defineProperty(Control.prototype, "disabledColor", {
|
|
1159
|
-
/** Gets or sets background color of control if it's disabled. Only applies to Button class. */
|
|
1160
|
-
get: function () {
|
|
1161
|
-
return this._disabledColor;
|
|
1162
|
-
},
|
|
1163
|
-
set: function (value) {
|
|
1164
|
-
if (this._disabledColor === value) {
|
|
1165
|
-
return;
|
|
1166
905
|
}
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
},
|
|
1170
|
-
enumerable: false,
|
|
1171
|
-
configurable: true
|
|
1172
|
-
});
|
|
1173
|
-
Object.defineProperty(Control.prototype, "disabledColorItem", {
|
|
1174
|
-
/** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */
|
|
1175
|
-
get: function () {
|
|
1176
|
-
return this._disabledColorItem;
|
|
1177
|
-
},
|
|
1178
|
-
set: function (value) {
|
|
1179
|
-
if (this._disabledColorItem === value) {
|
|
1180
|
-
return;
|
|
906
|
+
if (control.children !== undefined) {
|
|
907
|
+
control.children.forEach(recursivelyFirePointerOut);
|
|
1181
908
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
909
|
+
};
|
|
910
|
+
recursivelyFirePointerOut(this);
|
|
911
|
+
}
|
|
912
|
+
/** Gets or sets background color of control if it's disabled. Only applies to Button class. */
|
|
913
|
+
get disabledColor() {
|
|
914
|
+
return this._disabledColor;
|
|
915
|
+
}
|
|
916
|
+
set disabledColor(value) {
|
|
917
|
+
if (this._disabledColor === value) {
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
this._disabledColor = value;
|
|
921
|
+
this._markAsDirty();
|
|
922
|
+
}
|
|
923
|
+
/** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */
|
|
924
|
+
get disabledColorItem() {
|
|
925
|
+
return this._disabledColorItem;
|
|
926
|
+
}
|
|
927
|
+
set disabledColorItem(value) {
|
|
928
|
+
if (this._disabledColorItem === value) {
|
|
929
|
+
return;
|
|
930
|
+
}
|
|
931
|
+
this._disabledColorItem = value;
|
|
932
|
+
this._markAsDirty();
|
|
933
|
+
}
|
|
1188
934
|
/** @hidden */
|
|
1189
|
-
|
|
935
|
+
_getTypeName() {
|
|
1190
936
|
return "Control";
|
|
1191
|
-
}
|
|
937
|
+
}
|
|
1192
938
|
/**
|
|
1193
939
|
* Gets the first ascendant in the hierarchy of the given type
|
|
1194
940
|
* @param className defines the required type
|
|
1195
941
|
* @returns the ascendant or null if not found
|
|
1196
942
|
*/
|
|
1197
|
-
|
|
943
|
+
getAscendantOfClass(className) {
|
|
1198
944
|
if (!this.parent) {
|
|
1199
945
|
return null;
|
|
1200
946
|
}
|
|
@@ -1202,32 +948,31 @@ var Control = /** @class */ (function () {
|
|
|
1202
948
|
return this.parent;
|
|
1203
949
|
}
|
|
1204
950
|
return this.parent.getAscendantOfClass(className);
|
|
1205
|
-
}
|
|
951
|
+
}
|
|
1206
952
|
/**
|
|
1207
953
|
* Mark control element as dirty
|
|
1208
954
|
* @param force force non visible elements to be marked too
|
|
1209
955
|
*/
|
|
1210
|
-
|
|
1211
|
-
if (force === void 0) { force = false; }
|
|
956
|
+
markAsDirty(force = false) {
|
|
1212
957
|
this._markAsDirty(force);
|
|
1213
|
-
}
|
|
958
|
+
}
|
|
1214
959
|
/**
|
|
1215
960
|
* Mark the element and its children as dirty
|
|
1216
961
|
*/
|
|
1217
|
-
|
|
962
|
+
markAllAsDirty() {
|
|
1218
963
|
this._markAllAsDirty();
|
|
1219
|
-
}
|
|
964
|
+
}
|
|
1220
965
|
/** @hidden */
|
|
1221
|
-
|
|
966
|
+
_resetFontCache() {
|
|
1222
967
|
this._fontSet = true;
|
|
1223
968
|
this._markAsDirty();
|
|
1224
|
-
}
|
|
969
|
+
}
|
|
1225
970
|
/**
|
|
1226
971
|
* Determines if a container is an ascendant of the current control
|
|
1227
972
|
* @param container defines the container to look for
|
|
1228
973
|
* @returns true if the container is one of the ascendant of the control
|
|
1229
974
|
*/
|
|
1230
|
-
|
|
975
|
+
isAscendant(container) {
|
|
1231
976
|
if (!this.parent) {
|
|
1232
977
|
return false;
|
|
1233
978
|
}
|
|
@@ -1235,94 +980,93 @@ var Control = /** @class */ (function () {
|
|
|
1235
980
|
return true;
|
|
1236
981
|
}
|
|
1237
982
|
return this.parent.isAscendant(container);
|
|
1238
|
-
}
|
|
983
|
+
}
|
|
1239
984
|
/**
|
|
1240
985
|
* Gets coordinates in local control space
|
|
1241
986
|
* @param globalCoordinates defines the coordinates to transform
|
|
1242
987
|
* @returns the new coordinates in local space
|
|
1243
988
|
*/
|
|
1244
|
-
|
|
1245
|
-
|
|
989
|
+
getLocalCoordinates(globalCoordinates) {
|
|
990
|
+
const result = Vector2.Zero();
|
|
1246
991
|
this.getLocalCoordinatesToRef(globalCoordinates, result);
|
|
1247
992
|
return result;
|
|
1248
|
-
}
|
|
993
|
+
}
|
|
1249
994
|
/**
|
|
1250
995
|
* Gets coordinates in local control space
|
|
1251
996
|
* @param globalCoordinates defines the coordinates to transform
|
|
1252
997
|
* @param result defines the target vector2 where to store the result
|
|
1253
998
|
* @returns the current control
|
|
1254
999
|
*/
|
|
1255
|
-
|
|
1000
|
+
getLocalCoordinatesToRef(globalCoordinates, result) {
|
|
1256
1001
|
result.x = globalCoordinates.x - this._currentMeasure.left;
|
|
1257
1002
|
result.y = globalCoordinates.y - this._currentMeasure.top;
|
|
1258
1003
|
return this;
|
|
1259
|
-
}
|
|
1004
|
+
}
|
|
1260
1005
|
/**
|
|
1261
1006
|
* Gets coordinates in parent local control space
|
|
1262
1007
|
* @param globalCoordinates defines the coordinates to transform
|
|
1263
1008
|
* @returns the new coordinates in parent local space
|
|
1264
1009
|
*/
|
|
1265
|
-
|
|
1266
|
-
|
|
1010
|
+
getParentLocalCoordinates(globalCoordinates) {
|
|
1011
|
+
const result = Vector2.Zero();
|
|
1267
1012
|
result.x = globalCoordinates.x - this._cachedParentMeasure.left;
|
|
1268
1013
|
result.y = globalCoordinates.y - this._cachedParentMeasure.top;
|
|
1269
1014
|
return result;
|
|
1270
|
-
}
|
|
1015
|
+
}
|
|
1271
1016
|
/**
|
|
1272
1017
|
* Move the current control to a vector3 position projected onto the screen.
|
|
1273
1018
|
* @param position defines the target position
|
|
1274
1019
|
* @param scene defines the hosting scene
|
|
1275
1020
|
*/
|
|
1276
|
-
|
|
1021
|
+
moveToVector3(position, scene) {
|
|
1277
1022
|
if (!this._host || this.parent !== this._host._rootContainer) {
|
|
1278
1023
|
Tools.Error("Cannot move a control to a vector3 if the control is not at root level");
|
|
1279
1024
|
return;
|
|
1280
1025
|
}
|
|
1281
1026
|
this.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
1282
1027
|
this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
|
|
1283
|
-
|
|
1284
|
-
|
|
1028
|
+
const globalViewport = this._host._getGlobalViewport();
|
|
1029
|
+
const projectedPosition = Vector3.Project(position, Matrix.Identity(), scene.getTransformMatrix(), globalViewport);
|
|
1285
1030
|
this._moveToProjectedPosition(projectedPosition);
|
|
1286
1031
|
if (projectedPosition.z < 0 || projectedPosition.z > 1) {
|
|
1287
1032
|
this.notRenderable = true;
|
|
1288
1033
|
return;
|
|
1289
1034
|
}
|
|
1290
1035
|
this.notRenderable = false;
|
|
1291
|
-
}
|
|
1036
|
+
}
|
|
1292
1037
|
/**
|
|
1293
1038
|
* Will store all controls that have this control as ascendant in a given array
|
|
1294
1039
|
* @param results defines the array where to store the descendants
|
|
1295
1040
|
* @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
|
|
1296
1041
|
* @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
|
|
1297
1042
|
*/
|
|
1298
|
-
|
|
1299
|
-
if (directDescendantsOnly === void 0) { directDescendantsOnly = false; }
|
|
1043
|
+
getDescendantsToRef(results, directDescendantsOnly = false, predicate) {
|
|
1300
1044
|
// Do nothing by default
|
|
1301
|
-
}
|
|
1045
|
+
}
|
|
1302
1046
|
/**
|
|
1303
1047
|
* Will return all controls that have this control as ascendant
|
|
1304
1048
|
* @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
|
|
1305
1049
|
* @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
|
|
1306
1050
|
* @return all child controls
|
|
1307
1051
|
*/
|
|
1308
|
-
|
|
1309
|
-
|
|
1052
|
+
getDescendants(directDescendantsOnly, predicate) {
|
|
1053
|
+
const results = new Array();
|
|
1310
1054
|
this.getDescendantsToRef(results, directDescendantsOnly, predicate);
|
|
1311
1055
|
return results;
|
|
1312
|
-
}
|
|
1056
|
+
}
|
|
1313
1057
|
/**
|
|
1314
1058
|
* Link current control with a target mesh
|
|
1315
1059
|
* @param mesh defines the mesh to link with
|
|
1316
1060
|
* @see https://doc.babylonjs.com/how_to/gui#tracking-positions
|
|
1317
1061
|
*/
|
|
1318
|
-
|
|
1062
|
+
linkWithMesh(mesh) {
|
|
1319
1063
|
if (!this._host || (this.parent && this.parent !== this._host._rootContainer)) {
|
|
1320
1064
|
if (mesh) {
|
|
1321
1065
|
Tools.Error("Cannot link a control to a mesh if the control is not at root level");
|
|
1322
1066
|
}
|
|
1323
1067
|
return;
|
|
1324
1068
|
}
|
|
1325
|
-
|
|
1069
|
+
const index = this._host._linkedControls.indexOf(this);
|
|
1326
1070
|
if (index !== -1) {
|
|
1327
1071
|
this._linkedMesh = mesh;
|
|
1328
1072
|
if (!mesh) {
|
|
@@ -1337,7 +1081,7 @@ var Control = /** @class */ (function () {
|
|
|
1337
1081
|
this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
|
|
1338
1082
|
this._linkedMesh = mesh;
|
|
1339
1083
|
this._host._linkedControls.push(this);
|
|
1340
|
-
}
|
|
1084
|
+
}
|
|
1341
1085
|
/**
|
|
1342
1086
|
* Shorthand function to set the top, right, bottom, and left padding values on the control.
|
|
1343
1087
|
* @param { string | number} paddingTop - The value of the top padding.
|
|
@@ -1346,16 +1090,16 @@ var Control = /** @class */ (function () {
|
|
|
1346
1090
|
* @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.
|
|
1347
1091
|
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
1348
1092
|
*/
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1093
|
+
setPadding(paddingTop, paddingRight, paddingBottom, paddingLeft) {
|
|
1094
|
+
const top = paddingTop;
|
|
1095
|
+
const right = paddingRight ?? top;
|
|
1096
|
+
const bottom = paddingBottom ?? top;
|
|
1097
|
+
const left = paddingLeft ?? right;
|
|
1354
1098
|
this.paddingTop = top;
|
|
1355
1099
|
this.paddingRight = right;
|
|
1356
1100
|
this.paddingBottom = bottom;
|
|
1357
1101
|
this.paddingLeft = left;
|
|
1358
|
-
}
|
|
1102
|
+
}
|
|
1359
1103
|
/**
|
|
1360
1104
|
* Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.
|
|
1361
1105
|
* @param { number} paddingTop - The value in pixels of the top padding.
|
|
@@ -1364,30 +1108,29 @@ var Control = /** @class */ (function () {
|
|
|
1364
1108
|
* @param { number} paddingLeft - The value in pixels of the left padding. If omitted, right is used.
|
|
1365
1109
|
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
1366
1110
|
*/
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1111
|
+
setPaddingInPixels(paddingTop, paddingRight, paddingBottom, paddingLeft) {
|
|
1112
|
+
const top = paddingTop;
|
|
1113
|
+
const right = paddingRight ?? top;
|
|
1114
|
+
const bottom = paddingBottom ?? top;
|
|
1115
|
+
const left = paddingLeft ?? right;
|
|
1372
1116
|
this.paddingTopInPixels = top;
|
|
1373
1117
|
this.paddingRightInPixels = right;
|
|
1374
1118
|
this.paddingBottomInPixels = bottom;
|
|
1375
1119
|
this.paddingLeftInPixels = left;
|
|
1376
|
-
}
|
|
1120
|
+
}
|
|
1377
1121
|
/**
|
|
1378
1122
|
* @param projectedPosition
|
|
1379
1123
|
* @hidden
|
|
1380
1124
|
*/
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
var parentMeasure = (_a = this.parent) === null || _a === void 0 ? void 0 : _a._currentMeasure;
|
|
1125
|
+
_moveToProjectedPosition(projectedPosition) {
|
|
1126
|
+
const oldLeft = this._left.getValue(this._host);
|
|
1127
|
+
const oldTop = this._top.getValue(this._host);
|
|
1128
|
+
const parentMeasure = this.parent?._currentMeasure;
|
|
1386
1129
|
if (parentMeasure) {
|
|
1387
1130
|
this._processMeasures(parentMeasure, this._host.getContext());
|
|
1388
1131
|
}
|
|
1389
|
-
|
|
1390
|
-
|
|
1132
|
+
let newLeft = projectedPosition.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2;
|
|
1133
|
+
let newTop = projectedPosition.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2;
|
|
1391
1134
|
if (this._left.ignoreAdaptiveScaling && this._top.ignoreAdaptiveScaling) {
|
|
1392
1135
|
if (Math.abs(newLeft - oldLeft) < 0.5) {
|
|
1393
1136
|
newLeft = oldLeft;
|
|
@@ -1401,38 +1144,38 @@ var Control = /** @class */ (function () {
|
|
|
1401
1144
|
this._left.ignoreAdaptiveScaling = true;
|
|
1402
1145
|
this._top.ignoreAdaptiveScaling = true;
|
|
1403
1146
|
this._markAsDirty();
|
|
1404
|
-
}
|
|
1147
|
+
}
|
|
1405
1148
|
/**
|
|
1406
1149
|
* @param offset
|
|
1407
1150
|
* @hidden
|
|
1408
1151
|
*/
|
|
1409
|
-
|
|
1152
|
+
_offsetLeft(offset) {
|
|
1410
1153
|
this._isDirty = true;
|
|
1411
1154
|
this._currentMeasure.left += offset;
|
|
1412
|
-
}
|
|
1155
|
+
}
|
|
1413
1156
|
/**
|
|
1414
1157
|
* @param offset
|
|
1415
1158
|
* @hidden
|
|
1416
1159
|
*/
|
|
1417
|
-
|
|
1160
|
+
_offsetTop(offset) {
|
|
1418
1161
|
this._isDirty = true;
|
|
1419
1162
|
this._currentMeasure.top += offset;
|
|
1420
|
-
}
|
|
1163
|
+
}
|
|
1421
1164
|
/** @hidden */
|
|
1422
|
-
|
|
1165
|
+
_markMatrixAsDirty() {
|
|
1423
1166
|
this._isMatrixDirty = true;
|
|
1424
1167
|
this._flagDescendantsAsMatrixDirty();
|
|
1425
|
-
}
|
|
1168
|
+
}
|
|
1426
1169
|
/** @hidden */
|
|
1427
|
-
|
|
1170
|
+
_flagDescendantsAsMatrixDirty() {
|
|
1428
1171
|
// No child
|
|
1429
|
-
}
|
|
1172
|
+
}
|
|
1430
1173
|
/**
|
|
1431
1174
|
* @param rect
|
|
1432
1175
|
* @param context
|
|
1433
1176
|
* @hidden
|
|
1434
1177
|
*/
|
|
1435
|
-
|
|
1178
|
+
_intersectsRect(rect, context) {
|
|
1436
1179
|
// make sure we are transformed correctly before checking intersections. no-op if nothing is dirty.
|
|
1437
1180
|
this._transform(context);
|
|
1438
1181
|
if (this._evaluatedMeasure.left >= rect.left + rect.width) {
|
|
@@ -1448,18 +1191,18 @@ var Control = /** @class */ (function () {
|
|
|
1448
1191
|
return false;
|
|
1449
1192
|
}
|
|
1450
1193
|
return true;
|
|
1451
|
-
}
|
|
1194
|
+
}
|
|
1452
1195
|
/** @hidden */
|
|
1453
|
-
|
|
1196
|
+
_computeAdditionnalOffsetX() {
|
|
1454
1197
|
return 0;
|
|
1455
|
-
}
|
|
1198
|
+
}
|
|
1456
1199
|
/** @hidden */
|
|
1457
|
-
|
|
1200
|
+
_computeAdditionnalOffsetY() {
|
|
1458
1201
|
return 0;
|
|
1459
|
-
}
|
|
1202
|
+
}
|
|
1460
1203
|
/** @hidden */
|
|
1461
1204
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1462
|
-
|
|
1205
|
+
invalidateRect() {
|
|
1463
1206
|
this._transform();
|
|
1464
1207
|
if (this.host && this.host.useInvalidateRectOptimization) {
|
|
1465
1208
|
// Rotate by transform to get the measure transformed to global space
|
|
@@ -1468,24 +1211,23 @@ var Control = /** @class */ (function () {
|
|
|
1468
1211
|
// the previous measure is used to properly clear a control that is scaled down
|
|
1469
1212
|
Measure.CombineToRef(this._tmpMeasureA, this._prevCurrentMeasureTransformedIntoGlobalSpace, this._tmpMeasureA);
|
|
1470
1213
|
// Expand rect based on shadows
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1214
|
+
const shadowOffsetX = this.shadowOffsetX;
|
|
1215
|
+
const shadowOffsetY = this.shadowOffsetY;
|
|
1216
|
+
const shadowBlur = Math.max(this._previousShadowBlur, this.shadowBlur);
|
|
1217
|
+
const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);
|
|
1218
|
+
const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);
|
|
1219
|
+
const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);
|
|
1220
|
+
const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);
|
|
1221
|
+
const offsetX = this._computeAdditionnalOffsetX();
|
|
1222
|
+
const offsetY = this._computeAdditionnalOffsetY();
|
|
1480
1223
|
this.host.invalidateRect(Math.floor(this._tmpMeasureA.left + leftShadowOffset - offsetX), Math.floor(this._tmpMeasureA.top + topShadowOffset - offsetY), Math.ceil(this._tmpMeasureA.left + this._tmpMeasureA.width + rightShadowOffset + offsetX), Math.ceil(this._tmpMeasureA.top + this._tmpMeasureA.height + bottomShadowOffset + offsetY));
|
|
1481
1224
|
}
|
|
1482
|
-
}
|
|
1225
|
+
}
|
|
1483
1226
|
/**
|
|
1484
1227
|
* @param force
|
|
1485
1228
|
* @hidden
|
|
1486
1229
|
*/
|
|
1487
|
-
|
|
1488
|
-
if (force === void 0) { force = false; }
|
|
1230
|
+
_markAsDirty(force = false) {
|
|
1489
1231
|
if (!this._isVisible && !force) {
|
|
1490
1232
|
return;
|
|
1491
1233
|
}
|
|
@@ -1495,35 +1237,35 @@ var Control = /** @class */ (function () {
|
|
|
1495
1237
|
if (this._host) {
|
|
1496
1238
|
this._host.markAsDirty();
|
|
1497
1239
|
}
|
|
1498
|
-
}
|
|
1240
|
+
}
|
|
1499
1241
|
/** @hidden */
|
|
1500
|
-
|
|
1242
|
+
_markAllAsDirty() {
|
|
1501
1243
|
this._markAsDirty();
|
|
1502
1244
|
if (this._font) {
|
|
1503
1245
|
this._prepareFont();
|
|
1504
1246
|
}
|
|
1505
|
-
}
|
|
1247
|
+
}
|
|
1506
1248
|
/**
|
|
1507
1249
|
* @param host
|
|
1508
1250
|
* @hidden
|
|
1509
1251
|
*/
|
|
1510
|
-
|
|
1252
|
+
_link(host) {
|
|
1511
1253
|
this._host = host;
|
|
1512
1254
|
if (this._host) {
|
|
1513
1255
|
this.uniqueId = this._host.getScene().getUniqueId();
|
|
1514
1256
|
}
|
|
1515
|
-
}
|
|
1257
|
+
}
|
|
1516
1258
|
/**
|
|
1517
1259
|
* @param context
|
|
1518
1260
|
* @hidden
|
|
1519
1261
|
*/
|
|
1520
|
-
|
|
1262
|
+
_transform(context) {
|
|
1521
1263
|
if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0) {
|
|
1522
1264
|
return;
|
|
1523
1265
|
}
|
|
1524
1266
|
// postTranslate
|
|
1525
|
-
|
|
1526
|
-
|
|
1267
|
+
const offsetX = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left;
|
|
1268
|
+
const offsetY = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top;
|
|
1527
1269
|
if (context) {
|
|
1528
1270
|
context.translate(offsetX, offsetY);
|
|
1529
1271
|
// rotate
|
|
@@ -1543,12 +1285,12 @@ var Control = /** @class */ (function () {
|
|
|
1543
1285
|
this._transformMatrix.invertToRef(this._invertTransformMatrix);
|
|
1544
1286
|
this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
|
|
1545
1287
|
}
|
|
1546
|
-
}
|
|
1288
|
+
}
|
|
1547
1289
|
/**
|
|
1548
1290
|
* @param context
|
|
1549
1291
|
* @hidden
|
|
1550
1292
|
*/
|
|
1551
|
-
|
|
1293
|
+
_renderHighlight(context) {
|
|
1552
1294
|
if (!this.isHighlighted) {
|
|
1553
1295
|
return;
|
|
1554
1296
|
}
|
|
@@ -1557,19 +1299,19 @@ var Control = /** @class */ (function () {
|
|
|
1557
1299
|
context.lineWidth = this._highlightLineWidth;
|
|
1558
1300
|
this._renderHighlightSpecific(context);
|
|
1559
1301
|
context.restore();
|
|
1560
|
-
}
|
|
1302
|
+
}
|
|
1561
1303
|
/**
|
|
1562
1304
|
* @param context
|
|
1563
1305
|
* @hidden
|
|
1564
1306
|
*/
|
|
1565
|
-
|
|
1307
|
+
_renderHighlightSpecific(context) {
|
|
1566
1308
|
context.strokeRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
|
|
1567
|
-
}
|
|
1309
|
+
}
|
|
1568
1310
|
/**
|
|
1569
1311
|
* @param context
|
|
1570
1312
|
* @hidden
|
|
1571
1313
|
*/
|
|
1572
|
-
|
|
1314
|
+
_applyStates(context) {
|
|
1573
1315
|
if (this._isFontSizeInPercentage) {
|
|
1574
1316
|
this._fontSet = true;
|
|
1575
1317
|
}
|
|
@@ -1592,13 +1334,13 @@ var Control = /** @class */ (function () {
|
|
|
1592
1334
|
else if (this._alphaSet) {
|
|
1593
1335
|
context.globalAlpha = this.parent && !this.parent.renderToIntermediateTexture ? this.parent.alpha * this._alpha : this._alpha;
|
|
1594
1336
|
}
|
|
1595
|
-
}
|
|
1337
|
+
}
|
|
1596
1338
|
/**
|
|
1597
1339
|
* @param parentMeasure
|
|
1598
1340
|
* @param context
|
|
1599
1341
|
* @hidden
|
|
1600
1342
|
*/
|
|
1601
|
-
|
|
1343
|
+
_layout(parentMeasure, context) {
|
|
1602
1344
|
if (!this.isDirty && (!this.isVisible || this.notRenderable)) {
|
|
1603
1345
|
return false;
|
|
1604
1346
|
}
|
|
@@ -1607,14 +1349,14 @@ var Control = /** @class */ (function () {
|
|
|
1607
1349
|
this._currentMeasure.addAndTransformToRef(this._transformMatrix, -this._paddingLeftInPixels | 0, -this._paddingTopInPixels | 0, this._paddingRightInPixels | 0, this._paddingBottomInPixels | 0, this._prevCurrentMeasureTransformedIntoGlobalSpace);
|
|
1608
1350
|
context.save();
|
|
1609
1351
|
this._applyStates(context);
|
|
1610
|
-
|
|
1352
|
+
let rebuildCount = 0;
|
|
1611
1353
|
do {
|
|
1612
1354
|
this._rebuildLayout = false;
|
|
1613
1355
|
this._processMeasures(parentMeasure, context);
|
|
1614
1356
|
rebuildCount++;
|
|
1615
1357
|
} while (this._rebuildLayout && rebuildCount < 3);
|
|
1616
1358
|
if (rebuildCount >= 3) {
|
|
1617
|
-
Logger.Error(
|
|
1359
|
+
Logger.Error(`Layout cycle detected in GUI (Control name=${this.name}, uniqueId=${this.uniqueId})`);
|
|
1618
1360
|
}
|
|
1619
1361
|
context.restore();
|
|
1620
1362
|
this.invalidateRect();
|
|
@@ -1623,13 +1365,13 @@ var Control = /** @class */ (function () {
|
|
|
1623
1365
|
this._wasDirty = this._isDirty;
|
|
1624
1366
|
this._isDirty = false;
|
|
1625
1367
|
return true;
|
|
1626
|
-
}
|
|
1368
|
+
}
|
|
1627
1369
|
/**
|
|
1628
1370
|
* @param parentMeasure
|
|
1629
1371
|
* @param context
|
|
1630
1372
|
* @hidden
|
|
1631
1373
|
*/
|
|
1632
|
-
|
|
1374
|
+
_processMeasures(parentMeasure, context) {
|
|
1633
1375
|
this._tempPaddingMeasure.copyFrom(parentMeasure);
|
|
1634
1376
|
// Apply padding if in correct mode
|
|
1635
1377
|
if (this.parent && this.parent.descendantsOnlyPadding) {
|
|
@@ -1655,8 +1397,8 @@ var Control = /** @class */ (function () {
|
|
|
1655
1397
|
if (this.onDirtyObservable.hasObservers()) {
|
|
1656
1398
|
this.onDirtyObservable.notifyObservers(this);
|
|
1657
1399
|
}
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1400
|
+
}
|
|
1401
|
+
_evaluateClippingState(parentMeasure) {
|
|
1660
1402
|
this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
|
|
1661
1403
|
if (this.parent && this.parent.clipChildren) {
|
|
1662
1404
|
parentMeasure.transformToRef(this.parent._transformMatrix, this._evaluatedParentMeasure);
|
|
@@ -1679,9 +1421,9 @@ var Control = /** @class */ (function () {
|
|
|
1679
1421
|
}
|
|
1680
1422
|
}
|
|
1681
1423
|
this._isClipped = false;
|
|
1682
|
-
}
|
|
1424
|
+
}
|
|
1683
1425
|
/** @hidden */
|
|
1684
|
-
|
|
1426
|
+
_measure() {
|
|
1685
1427
|
// Width / Height
|
|
1686
1428
|
if (this._width.isPixel) {
|
|
1687
1429
|
this._currentMeasure.width = this._width.getValue(this._host);
|
|
@@ -1703,20 +1445,20 @@ var Control = /** @class */ (function () {
|
|
|
1703
1445
|
this._currentMeasure.width = this._currentMeasure.height * this.fixedRatio;
|
|
1704
1446
|
}
|
|
1705
1447
|
}
|
|
1706
|
-
}
|
|
1448
|
+
}
|
|
1707
1449
|
/**
|
|
1708
1450
|
* @param parentMeasure
|
|
1709
1451
|
* @param context
|
|
1710
1452
|
* @hidden
|
|
1711
1453
|
*/
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1454
|
+
_computeAlignment(parentMeasure, context) {
|
|
1455
|
+
const width = this._currentMeasure.width;
|
|
1456
|
+
const height = this._currentMeasure.height;
|
|
1457
|
+
const parentWidth = parentMeasure.width;
|
|
1458
|
+
const parentHeight = parentMeasure.height;
|
|
1717
1459
|
// Left / top
|
|
1718
|
-
|
|
1719
|
-
|
|
1460
|
+
let x = 0;
|
|
1461
|
+
let y = 0;
|
|
1720
1462
|
switch (this.horizontalAlignment) {
|
|
1721
1463
|
case Control.HORIZONTAL_ALIGNMENT_LEFT:
|
|
1722
1464
|
x = 0;
|
|
@@ -1783,38 +1525,38 @@ var Control = /** @class */ (function () {
|
|
|
1783
1525
|
}
|
|
1784
1526
|
this._currentMeasure.left += x;
|
|
1785
1527
|
this._currentMeasure.top += y;
|
|
1786
|
-
}
|
|
1528
|
+
}
|
|
1787
1529
|
/**
|
|
1788
1530
|
* @param parentMeasure
|
|
1789
1531
|
* @param context
|
|
1790
1532
|
* @hidden
|
|
1791
1533
|
*/
|
|
1792
|
-
|
|
1534
|
+
_preMeasure(parentMeasure, context) {
|
|
1793
1535
|
// Do nothing
|
|
1794
|
-
}
|
|
1536
|
+
}
|
|
1795
1537
|
/**
|
|
1796
1538
|
* @param parentMeasure
|
|
1797
1539
|
* @param context
|
|
1798
1540
|
* @hidden
|
|
1799
1541
|
*/
|
|
1800
|
-
|
|
1542
|
+
_additionalProcessing(parentMeasure, context) {
|
|
1801
1543
|
// Do nothing
|
|
1802
|
-
}
|
|
1544
|
+
}
|
|
1803
1545
|
/**
|
|
1804
1546
|
* @param context
|
|
1805
1547
|
* @hidden
|
|
1806
1548
|
*/
|
|
1807
|
-
|
|
1549
|
+
_clipForChildren(context) {
|
|
1808
1550
|
// DO nothing
|
|
1809
|
-
}
|
|
1810
|
-
|
|
1551
|
+
}
|
|
1552
|
+
_clip(context, invalidatedRectangle) {
|
|
1811
1553
|
context.beginPath();
|
|
1812
1554
|
Control._ClipMeasure.copyFrom(this._currentMeasure);
|
|
1813
1555
|
if (invalidatedRectangle) {
|
|
1814
1556
|
// Rotate the invalidated rect into the control's space
|
|
1815
1557
|
invalidatedRectangle.transformToRef(this._invertTransformMatrix, this._tmpMeasureA);
|
|
1816
1558
|
// Get the intersection of the rect in context space and the current context
|
|
1817
|
-
|
|
1559
|
+
const intersection = new Measure(0, 0, 0, 0);
|
|
1818
1560
|
intersection.left = Math.max(this._tmpMeasureA.left, this._currentMeasure.left);
|
|
1819
1561
|
intersection.top = Math.max(this._tmpMeasureA.top, this._currentMeasure.top);
|
|
1820
1562
|
intersection.width = Math.min(this._tmpMeasureA.left + this._tmpMeasureA.width, this._currentMeasure.left + this._currentMeasure.width) - intersection.left;
|
|
@@ -1822,26 +1564,26 @@ var Control = /** @class */ (function () {
|
|
|
1822
1564
|
Control._ClipMeasure.copyFrom(intersection);
|
|
1823
1565
|
}
|
|
1824
1566
|
if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1567
|
+
const shadowOffsetX = this.shadowOffsetX;
|
|
1568
|
+
const shadowOffsetY = this.shadowOffsetY;
|
|
1569
|
+
const shadowBlur = this.shadowBlur;
|
|
1570
|
+
const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);
|
|
1571
|
+
const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);
|
|
1572
|
+
const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);
|
|
1573
|
+
const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);
|
|
1832
1574
|
context.rect(Control._ClipMeasure.left + leftShadowOffset, Control._ClipMeasure.top + topShadowOffset, Control._ClipMeasure.width + rightShadowOffset - leftShadowOffset, Control._ClipMeasure.height + bottomShadowOffset - topShadowOffset);
|
|
1833
1575
|
}
|
|
1834
1576
|
else {
|
|
1835
1577
|
context.rect(Control._ClipMeasure.left, Control._ClipMeasure.top, Control._ClipMeasure.width, Control._ClipMeasure.height);
|
|
1836
1578
|
}
|
|
1837
1579
|
context.clip();
|
|
1838
|
-
}
|
|
1580
|
+
}
|
|
1839
1581
|
/**
|
|
1840
1582
|
* @param context
|
|
1841
1583
|
* @param invalidatedRectangle
|
|
1842
1584
|
* @hidden
|
|
1843
1585
|
*/
|
|
1844
|
-
|
|
1586
|
+
_render(context, invalidatedRectangle) {
|
|
1845
1587
|
if (!this.isVisible || this.notRenderable || this._isClipped) {
|
|
1846
1588
|
this._isDirty = false;
|
|
1847
1589
|
return false;
|
|
@@ -1873,22 +1615,22 @@ var Control = /** @class */ (function () {
|
|
|
1873
1615
|
}
|
|
1874
1616
|
context.restore();
|
|
1875
1617
|
return true;
|
|
1876
|
-
}
|
|
1618
|
+
}
|
|
1877
1619
|
/**
|
|
1878
1620
|
* @param context
|
|
1879
1621
|
* @param invalidatedRectangle
|
|
1880
1622
|
* @hidden
|
|
1881
1623
|
*/
|
|
1882
|
-
|
|
1624
|
+
_draw(context, invalidatedRectangle) {
|
|
1883
1625
|
// Do nothing
|
|
1884
|
-
}
|
|
1626
|
+
}
|
|
1885
1627
|
/**
|
|
1886
1628
|
* Tests if a given coordinates belong to the current control
|
|
1887
1629
|
* @param x defines x coordinate to test
|
|
1888
1630
|
* @param y defines y coordinate to test
|
|
1889
1631
|
* @returns true if the coordinates are inside the control
|
|
1890
1632
|
*/
|
|
1891
|
-
|
|
1633
|
+
contains(x, y) {
|
|
1892
1634
|
// Invert transform
|
|
1893
1635
|
this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);
|
|
1894
1636
|
x = this._transformedPosition.x;
|
|
@@ -1910,7 +1652,7 @@ var Control = /** @class */ (function () {
|
|
|
1910
1652
|
this._host._shouldBlockPointer = true;
|
|
1911
1653
|
}
|
|
1912
1654
|
return true;
|
|
1913
|
-
}
|
|
1655
|
+
}
|
|
1914
1656
|
/**
|
|
1915
1657
|
* @param x
|
|
1916
1658
|
* @param y
|
|
@@ -1922,7 +1664,7 @@ var Control = /** @class */ (function () {
|
|
|
1922
1664
|
* @param deltaY
|
|
1923
1665
|
* @hidden
|
|
1924
1666
|
*/
|
|
1925
|
-
|
|
1667
|
+
_processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
|
|
1926
1668
|
if (!this._isEnabled) {
|
|
1927
1669
|
return false;
|
|
1928
1670
|
}
|
|
@@ -1934,7 +1676,7 @@ var Control = /** @class */ (function () {
|
|
|
1934
1676
|
}
|
|
1935
1677
|
this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);
|
|
1936
1678
|
return true;
|
|
1937
|
-
}
|
|
1679
|
+
}
|
|
1938
1680
|
/**
|
|
1939
1681
|
* @param target
|
|
1940
1682
|
* @param coordinates
|
|
@@ -1942,18 +1684,18 @@ var Control = /** @class */ (function () {
|
|
|
1942
1684
|
* @param pi
|
|
1943
1685
|
* @hidden
|
|
1944
1686
|
*/
|
|
1945
|
-
|
|
1946
|
-
|
|
1687
|
+
_onPointerMove(target, coordinates, pointerId, pi) {
|
|
1688
|
+
const canNotify = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this, pi);
|
|
1947
1689
|
if (canNotify && this.parent != null && !this.isPointerBlocker) {
|
|
1948
1690
|
this.parent._onPointerMove(target, coordinates, pointerId, pi);
|
|
1949
1691
|
}
|
|
1950
|
-
}
|
|
1692
|
+
}
|
|
1951
1693
|
/**
|
|
1952
1694
|
* @param target
|
|
1953
1695
|
* @param pi
|
|
1954
1696
|
* @hidden
|
|
1955
1697
|
*/
|
|
1956
|
-
|
|
1698
|
+
_onPointerEnter(target, pi) {
|
|
1957
1699
|
if (!this._isEnabled) {
|
|
1958
1700
|
return false;
|
|
1959
1701
|
}
|
|
@@ -1965,32 +1707,31 @@ var Control = /** @class */ (function () {
|
|
|
1965
1707
|
this._enterCount = 0;
|
|
1966
1708
|
}
|
|
1967
1709
|
this._enterCount++;
|
|
1968
|
-
|
|
1710
|
+
const canNotify = this.onPointerEnterObservable.notifyObservers(this, -1, target, this, pi);
|
|
1969
1711
|
if (canNotify && this.parent != null && !this.isPointerBlocker) {
|
|
1970
1712
|
this.parent._onPointerEnter(target, pi);
|
|
1971
1713
|
}
|
|
1972
1714
|
return true;
|
|
1973
|
-
}
|
|
1715
|
+
}
|
|
1974
1716
|
/**
|
|
1975
1717
|
* @param target
|
|
1976
1718
|
* @param pi
|
|
1977
1719
|
* @param force
|
|
1978
1720
|
* @hidden
|
|
1979
1721
|
*/
|
|
1980
|
-
|
|
1981
|
-
if (force === void 0) { force = false; }
|
|
1722
|
+
_onPointerOut(target, pi, force = false) {
|
|
1982
1723
|
if (!force && (!this._isEnabled || target === this)) {
|
|
1983
1724
|
return;
|
|
1984
1725
|
}
|
|
1985
1726
|
this._enterCount = 0;
|
|
1986
|
-
|
|
1727
|
+
let canNotify = true;
|
|
1987
1728
|
if (!target.isAscendant(this)) {
|
|
1988
1729
|
canNotify = this.onPointerOutObservable.notifyObservers(this, -1, target, this, pi);
|
|
1989
1730
|
}
|
|
1990
1731
|
if (canNotify && this.parent != null && !this.isPointerBlocker) {
|
|
1991
1732
|
this.parent._onPointerOut(target, pi, force);
|
|
1992
1733
|
}
|
|
1993
|
-
}
|
|
1734
|
+
}
|
|
1994
1735
|
/**
|
|
1995
1736
|
* @param target
|
|
1996
1737
|
* @param coordinates
|
|
@@ -1999,7 +1740,7 @@ var Control = /** @class */ (function () {
|
|
|
1999
1740
|
* @param pi
|
|
2000
1741
|
* @hidden
|
|
2001
1742
|
*/
|
|
2002
|
-
|
|
1743
|
+
_onPointerDown(target, coordinates, pointerId, buttonIndex, pi) {
|
|
2003
1744
|
// Prevent pointerout to lose control context.
|
|
2004
1745
|
// Event redundancy is checked inside the function.
|
|
2005
1746
|
this._onPointerEnter(this, pi);
|
|
@@ -2008,7 +1749,7 @@ var Control = /** @class */ (function () {
|
|
|
2008
1749
|
}
|
|
2009
1750
|
this._downCount++;
|
|
2010
1751
|
this._downPointerIds[pointerId] = true;
|
|
2011
|
-
|
|
1752
|
+
const canNotify = this.onPointerDownObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
|
|
2012
1753
|
if (canNotify && this.parent != null && !this.isPointerBlocker) {
|
|
2013
1754
|
this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);
|
|
2014
1755
|
}
|
|
@@ -2016,7 +1757,7 @@ var Control = /** @class */ (function () {
|
|
|
2016
1757
|
this._host._capturedPointerIds.add(pi.event.pointerId);
|
|
2017
1758
|
}
|
|
2018
1759
|
return true;
|
|
2019
|
-
}
|
|
1760
|
+
}
|
|
2020
1761
|
/**
|
|
2021
1762
|
* @param target
|
|
2022
1763
|
* @param coordinates
|
|
@@ -2026,55 +1767,54 @@ var Control = /** @class */ (function () {
|
|
|
2026
1767
|
* @param pi
|
|
2027
1768
|
* @hidden
|
|
2028
1769
|
*/
|
|
2029
|
-
|
|
1770
|
+
_onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) {
|
|
2030
1771
|
if (!this._isEnabled) {
|
|
2031
1772
|
return;
|
|
2032
1773
|
}
|
|
2033
1774
|
this._downCount = 0;
|
|
2034
1775
|
delete this._downPointerIds[pointerId];
|
|
2035
|
-
|
|
1776
|
+
let canNotifyClick = notifyClick;
|
|
2036
1777
|
if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) {
|
|
2037
1778
|
canNotifyClick = this.onPointerClickObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
|
|
2038
1779
|
}
|
|
2039
|
-
|
|
1780
|
+
const canNotify = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
|
|
2040
1781
|
if (canNotify && this.parent != null && !this.isPointerBlocker) {
|
|
2041
1782
|
this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick, pi);
|
|
2042
1783
|
}
|
|
2043
1784
|
if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) {
|
|
2044
1785
|
this._host._capturedPointerIds.delete(pi.event.pointerId);
|
|
2045
1786
|
}
|
|
2046
|
-
}
|
|
1787
|
+
}
|
|
2047
1788
|
/**
|
|
2048
1789
|
* @param pointerId
|
|
2049
1790
|
* @hidden
|
|
2050
1791
|
*/
|
|
2051
|
-
|
|
2052
|
-
if (pointerId === void 0) { pointerId = null; }
|
|
1792
|
+
_forcePointerUp(pointerId = null) {
|
|
2053
1793
|
if (pointerId !== null) {
|
|
2054
1794
|
this._onPointerUp(this, Vector2.Zero(), pointerId, 0, true);
|
|
2055
1795
|
}
|
|
2056
1796
|
else {
|
|
2057
|
-
for (
|
|
1797
|
+
for (const key in this._downPointerIds) {
|
|
2058
1798
|
this._onPointerUp(this, Vector2.Zero(), +key, 0, true);
|
|
2059
1799
|
}
|
|
2060
1800
|
}
|
|
2061
|
-
}
|
|
1801
|
+
}
|
|
2062
1802
|
/**
|
|
2063
1803
|
* @param deltaX
|
|
2064
1804
|
* @param deltaY
|
|
2065
1805
|
* @hidden
|
|
2066
1806
|
*/
|
|
2067
|
-
|
|
1807
|
+
_onWheelScroll(deltaX, deltaY) {
|
|
2068
1808
|
if (!this._isEnabled) {
|
|
2069
1809
|
return;
|
|
2070
1810
|
}
|
|
2071
|
-
|
|
1811
|
+
const canNotify = this.onWheelObservable.notifyObservers(new Vector2(deltaX, deltaY));
|
|
2072
1812
|
if (canNotify && this.parent != null) {
|
|
2073
1813
|
this.parent._onWheelScroll(deltaX, deltaY);
|
|
2074
1814
|
}
|
|
2075
|
-
}
|
|
1815
|
+
}
|
|
2076
1816
|
/** @hidden */
|
|
2077
|
-
|
|
1817
|
+
_onCanvasBlur() { }
|
|
2078
1818
|
/**
|
|
2079
1819
|
* @param type
|
|
2080
1820
|
* @param x
|
|
@@ -2086,14 +1826,14 @@ var Control = /** @class */ (function () {
|
|
|
2086
1826
|
* @param deltaY
|
|
2087
1827
|
* @hidden
|
|
2088
1828
|
*/
|
|
2089
|
-
|
|
1829
|
+
_processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY) {
|
|
2090
1830
|
if (!this._isEnabled) {
|
|
2091
1831
|
return false;
|
|
2092
1832
|
}
|
|
2093
1833
|
this._dummyVector2.copyFromFloats(x, y);
|
|
2094
1834
|
if (type === PointerEventTypes.POINTERMOVE) {
|
|
2095
1835
|
this._onPointerMove(this, this._dummyVector2, pointerId, pi);
|
|
2096
|
-
|
|
1836
|
+
const previousControlOver = this._host._lastControlOver[pointerId];
|
|
2097
1837
|
if (previousControlOver && previousControlOver !== this) {
|
|
2098
1838
|
previousControlOver._onPointerOut(this, pi);
|
|
2099
1839
|
}
|
|
@@ -2123,8 +1863,8 @@ var Control = /** @class */ (function () {
|
|
|
2123
1863
|
}
|
|
2124
1864
|
}
|
|
2125
1865
|
return false;
|
|
2126
|
-
}
|
|
2127
|
-
|
|
1866
|
+
}
|
|
1867
|
+
_prepareFont() {
|
|
2128
1868
|
if (!this._font && !this._fontSet) {
|
|
2129
1869
|
return;
|
|
2130
1870
|
}
|
|
@@ -2136,13 +1876,13 @@ var Control = /** @class */ (function () {
|
|
|
2136
1876
|
}
|
|
2137
1877
|
this._fontOffset = Control._GetFontOffset(this._font);
|
|
2138
1878
|
//children need to be refreshed
|
|
2139
|
-
this.getDescendants().forEach(
|
|
2140
|
-
}
|
|
1879
|
+
this.getDescendants().forEach((child) => child._markAllAsDirty());
|
|
1880
|
+
}
|
|
2141
1881
|
/**
|
|
2142
1882
|
* Serializes the current control
|
|
2143
1883
|
* @param serializationObject defined the JSON serialized object
|
|
2144
1884
|
*/
|
|
2145
|
-
|
|
1885
|
+
serialize(serializationObject) {
|
|
2146
1886
|
SerializationHelper.Serialize(this, serializationObject);
|
|
2147
1887
|
serializationObject.name = this.name;
|
|
2148
1888
|
serializationObject.className = this.getClassName();
|
|
@@ -2152,13 +1892,13 @@ var Control = /** @class */ (function () {
|
|
|
2152
1892
|
serializationObject.fontWeight = this.fontWeight;
|
|
2153
1893
|
serializationObject.fontStyle = this.fontStyle;
|
|
2154
1894
|
}
|
|
2155
|
-
}
|
|
1895
|
+
}
|
|
2156
1896
|
/**
|
|
2157
1897
|
* @param serializedObject
|
|
2158
1898
|
* @param host
|
|
2159
1899
|
* @hidden
|
|
2160
1900
|
*/
|
|
2161
|
-
|
|
1901
|
+
_parseFromContent(serializedObject, host) {
|
|
2162
1902
|
if (serializedObject.fontFamily) {
|
|
2163
1903
|
this.fontFamily = serializedObject.fontFamily;
|
|
2164
1904
|
}
|
|
@@ -2171,9 +1911,9 @@ var Control = /** @class */ (function () {
|
|
|
2171
1911
|
if (serializedObject.fontStyle) {
|
|
2172
1912
|
this.fontStyle = serializedObject.fontStyle;
|
|
2173
1913
|
}
|
|
2174
|
-
}
|
|
1914
|
+
}
|
|
2175
1915
|
/** Releases associated resources */
|
|
2176
|
-
|
|
1916
|
+
dispose() {
|
|
2177
1917
|
this.onDirtyObservable.clear();
|
|
2178
1918
|
this.onBeforeDrawObservable.clear();
|
|
2179
1919
|
this.onAfterDrawObservable.clear();
|
|
@@ -2193,7 +1933,7 @@ var Control = /** @class */ (function () {
|
|
|
2193
1933
|
this.parent = null;
|
|
2194
1934
|
}
|
|
2195
1935
|
if (this._host) {
|
|
2196
|
-
|
|
1936
|
+
const index = this._host._linkedControls.indexOf(this);
|
|
2197
1937
|
if (index > -1) {
|
|
2198
1938
|
this.linkWithMesh(null);
|
|
2199
1939
|
}
|
|
@@ -2201,84 +1941,60 @@ var Control = /** @class */ (function () {
|
|
|
2201
1941
|
// Callback
|
|
2202
1942
|
this.onDisposeObservable.notifyObservers(this);
|
|
2203
1943
|
this.onDisposeObservable.clear();
|
|
2204
|
-
}
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
}
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
}
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
}
|
|
2229
|
-
Object.defineProperty(Control, "VERTICAL_ALIGNMENT_TOP", {
|
|
2230
|
-
/** VERTICAL_ALIGNMENT_TOP */
|
|
2231
|
-
get: function () {
|
|
2232
|
-
return Control._VERTICAL_ALIGNMENT_TOP;
|
|
2233
|
-
},
|
|
2234
|
-
enumerable: false,
|
|
2235
|
-
configurable: true
|
|
2236
|
-
});
|
|
2237
|
-
Object.defineProperty(Control, "VERTICAL_ALIGNMENT_BOTTOM", {
|
|
2238
|
-
/** VERTICAL_ALIGNMENT_BOTTOM */
|
|
2239
|
-
get: function () {
|
|
2240
|
-
return Control._VERTICAL_ALIGNMENT_BOTTOM;
|
|
2241
|
-
},
|
|
2242
|
-
enumerable: false,
|
|
2243
|
-
configurable: true
|
|
2244
|
-
});
|
|
2245
|
-
Object.defineProperty(Control, "VERTICAL_ALIGNMENT_CENTER", {
|
|
2246
|
-
/** VERTICAL_ALIGNMENT_CENTER */
|
|
2247
|
-
get: function () {
|
|
2248
|
-
return Control._VERTICAL_ALIGNMENT_CENTER;
|
|
2249
|
-
},
|
|
2250
|
-
enumerable: false,
|
|
2251
|
-
configurable: true
|
|
2252
|
-
});
|
|
1944
|
+
}
|
|
1945
|
+
/** HORIZONTAL_ALIGNMENT_LEFT */
|
|
1946
|
+
static get HORIZONTAL_ALIGNMENT_LEFT() {
|
|
1947
|
+
return Control._HORIZONTAL_ALIGNMENT_LEFT;
|
|
1948
|
+
}
|
|
1949
|
+
/** HORIZONTAL_ALIGNMENT_RIGHT */
|
|
1950
|
+
static get HORIZONTAL_ALIGNMENT_RIGHT() {
|
|
1951
|
+
return Control._HORIZONTAL_ALIGNMENT_RIGHT;
|
|
1952
|
+
}
|
|
1953
|
+
/** HORIZONTAL_ALIGNMENT_CENTER */
|
|
1954
|
+
static get HORIZONTAL_ALIGNMENT_CENTER() {
|
|
1955
|
+
return Control._HORIZONTAL_ALIGNMENT_CENTER;
|
|
1956
|
+
}
|
|
1957
|
+
/** VERTICAL_ALIGNMENT_TOP */
|
|
1958
|
+
static get VERTICAL_ALIGNMENT_TOP() {
|
|
1959
|
+
return Control._VERTICAL_ALIGNMENT_TOP;
|
|
1960
|
+
}
|
|
1961
|
+
/** VERTICAL_ALIGNMENT_BOTTOM */
|
|
1962
|
+
static get VERTICAL_ALIGNMENT_BOTTOM() {
|
|
1963
|
+
return Control._VERTICAL_ALIGNMENT_BOTTOM;
|
|
1964
|
+
}
|
|
1965
|
+
/** VERTICAL_ALIGNMENT_CENTER */
|
|
1966
|
+
static get VERTICAL_ALIGNMENT_CENTER() {
|
|
1967
|
+
return Control._VERTICAL_ALIGNMENT_CENTER;
|
|
1968
|
+
}
|
|
2253
1969
|
/**
|
|
2254
1970
|
* @param font
|
|
2255
1971
|
* @hidden
|
|
2256
1972
|
*/
|
|
2257
|
-
|
|
1973
|
+
static _GetFontOffset(font) {
|
|
2258
1974
|
if (Control._FontHeightSizes[font]) {
|
|
2259
1975
|
return Control._FontHeightSizes[font];
|
|
2260
1976
|
}
|
|
2261
|
-
|
|
1977
|
+
const engine = EngineStore.LastCreatedEngine;
|
|
2262
1978
|
if (!engine) {
|
|
2263
1979
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
2264
1980
|
}
|
|
2265
|
-
|
|
1981
|
+
const result = engine.getFontOffset(font);
|
|
2266
1982
|
Control._FontHeightSizes[font] = result;
|
|
2267
1983
|
return result;
|
|
2268
|
-
}
|
|
1984
|
+
}
|
|
2269
1985
|
/**
|
|
2270
1986
|
* Creates a Control from parsed data
|
|
2271
1987
|
* @param serializedObject defines parsed data
|
|
2272
1988
|
* @param host defines the hosting AdvancedDynamicTexture
|
|
2273
1989
|
* @returns a new Control
|
|
2274
1990
|
*/
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
1991
|
+
static Parse(serializedObject, host) {
|
|
1992
|
+
const controlType = Tools.Instantiate("BABYLON.GUI." + serializedObject.className);
|
|
1993
|
+
const control = SerializationHelper.Parse(() => new controlType(), serializedObject, null);
|
|
2278
1994
|
control.name = serializedObject.name;
|
|
2279
1995
|
control._parseFromContent(serializedObject, host);
|
|
2280
1996
|
return control;
|
|
2281
|
-
}
|
|
1997
|
+
}
|
|
2282
1998
|
/**
|
|
2283
1999
|
* @param x
|
|
2284
2000
|
* @param y
|
|
@@ -2287,7 +2003,7 @@ var Control = /** @class */ (function () {
|
|
|
2287
2003
|
* @param context
|
|
2288
2004
|
* @hidden
|
|
2289
2005
|
*/
|
|
2290
|
-
|
|
2006
|
+
static drawEllipse(x, y, width, height, context) {
|
|
2291
2007
|
context.translate(x, y);
|
|
2292
2008
|
context.scale(width, height);
|
|
2293
2009
|
context.beginPath();
|
|
@@ -2295,152 +2011,150 @@ var Control = /** @class */ (function () {
|
|
|
2295
2011
|
context.closePath();
|
|
2296
2012
|
context.scale(1 / width, 1 / height);
|
|
2297
2013
|
context.translate(-x, -y);
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
}());
|
|
2444
|
-
export { Control };
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
/**
|
|
2017
|
+
* Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
|
|
2018
|
+
*/
|
|
2019
|
+
Control.AllowAlphaInheritance = false;
|
|
2020
|
+
Control._ClipMeasure = new Measure(0, 0, 0, 0);
|
|
2021
|
+
// Statics
|
|
2022
|
+
Control._HORIZONTAL_ALIGNMENT_LEFT = 0;
|
|
2023
|
+
Control._HORIZONTAL_ALIGNMENT_RIGHT = 1;
|
|
2024
|
+
Control._HORIZONTAL_ALIGNMENT_CENTER = 2;
|
|
2025
|
+
Control._VERTICAL_ALIGNMENT_TOP = 0;
|
|
2026
|
+
Control._VERTICAL_ALIGNMENT_BOTTOM = 1;
|
|
2027
|
+
Control._VERTICAL_ALIGNMENT_CENTER = 2;
|
|
2028
|
+
Control._FontHeightSizes = {};
|
|
2029
|
+
Control.AddHeader = () => { };
|
|
2030
|
+
__decorate([
|
|
2031
|
+
serialize()
|
|
2032
|
+
], Control.prototype, "metadata", void 0);
|
|
2033
|
+
__decorate([
|
|
2034
|
+
serialize()
|
|
2035
|
+
], Control.prototype, "isHitTestVisible", void 0);
|
|
2036
|
+
__decorate([
|
|
2037
|
+
serialize()
|
|
2038
|
+
], Control.prototype, "isPointerBlocker", void 0);
|
|
2039
|
+
__decorate([
|
|
2040
|
+
serialize()
|
|
2041
|
+
], Control.prototype, "isFocusInvisible", void 0);
|
|
2042
|
+
__decorate([
|
|
2043
|
+
serialize()
|
|
2044
|
+
], Control.prototype, "clipChildren", void 0);
|
|
2045
|
+
__decorate([
|
|
2046
|
+
serialize()
|
|
2047
|
+
], Control.prototype, "clipContent", void 0);
|
|
2048
|
+
__decorate([
|
|
2049
|
+
serialize()
|
|
2050
|
+
], Control.prototype, "useBitmapCache", void 0);
|
|
2051
|
+
__decorate([
|
|
2052
|
+
serialize()
|
|
2053
|
+
], Control.prototype, "shadowOffsetX", null);
|
|
2054
|
+
__decorate([
|
|
2055
|
+
serialize()
|
|
2056
|
+
], Control.prototype, "shadowOffsetY", null);
|
|
2057
|
+
__decorate([
|
|
2058
|
+
serialize()
|
|
2059
|
+
], Control.prototype, "shadowBlur", null);
|
|
2060
|
+
__decorate([
|
|
2061
|
+
serialize()
|
|
2062
|
+
], Control.prototype, "shadowColor", null);
|
|
2063
|
+
__decorate([
|
|
2064
|
+
serialize()
|
|
2065
|
+
], Control.prototype, "hoverCursor", void 0);
|
|
2066
|
+
__decorate([
|
|
2067
|
+
serialize()
|
|
2068
|
+
], Control.prototype, "fontOffset", null);
|
|
2069
|
+
__decorate([
|
|
2070
|
+
serialize()
|
|
2071
|
+
], Control.prototype, "alpha", null);
|
|
2072
|
+
__decorate([
|
|
2073
|
+
serialize()
|
|
2074
|
+
], Control.prototype, "scaleX", null);
|
|
2075
|
+
__decorate([
|
|
2076
|
+
serialize()
|
|
2077
|
+
], Control.prototype, "scaleY", null);
|
|
2078
|
+
__decorate([
|
|
2079
|
+
serialize()
|
|
2080
|
+
], Control.prototype, "rotation", null);
|
|
2081
|
+
__decorate([
|
|
2082
|
+
serialize()
|
|
2083
|
+
], Control.prototype, "transformCenterY", null);
|
|
2084
|
+
__decorate([
|
|
2085
|
+
serialize()
|
|
2086
|
+
], Control.prototype, "transformCenterX", null);
|
|
2087
|
+
__decorate([
|
|
2088
|
+
serialize()
|
|
2089
|
+
], Control.prototype, "horizontalAlignment", null);
|
|
2090
|
+
__decorate([
|
|
2091
|
+
serialize()
|
|
2092
|
+
], Control.prototype, "verticalAlignment", null);
|
|
2093
|
+
__decorate([
|
|
2094
|
+
serialize()
|
|
2095
|
+
], Control.prototype, "fixedRatio", void 0);
|
|
2096
|
+
__decorate([
|
|
2097
|
+
serialize()
|
|
2098
|
+
], Control.prototype, "width", null);
|
|
2099
|
+
__decorate([
|
|
2100
|
+
serialize()
|
|
2101
|
+
], Control.prototype, "height", null);
|
|
2102
|
+
__decorate([
|
|
2103
|
+
serialize()
|
|
2104
|
+
], Control.prototype, "style", null);
|
|
2105
|
+
__decorate([
|
|
2106
|
+
serialize()
|
|
2107
|
+
], Control.prototype, "color", null);
|
|
2108
|
+
__decorate([
|
|
2109
|
+
serialize()
|
|
2110
|
+
], Control.prototype, "zIndex", null);
|
|
2111
|
+
__decorate([
|
|
2112
|
+
serialize()
|
|
2113
|
+
], Control.prototype, "notRenderable", null);
|
|
2114
|
+
__decorate([
|
|
2115
|
+
serialize()
|
|
2116
|
+
], Control.prototype, "isVisible", null);
|
|
2117
|
+
__decorate([
|
|
2118
|
+
serialize()
|
|
2119
|
+
], Control.prototype, "descendantsOnlyPadding", null);
|
|
2120
|
+
__decorate([
|
|
2121
|
+
serialize()
|
|
2122
|
+
], Control.prototype, "paddingLeft", null);
|
|
2123
|
+
__decorate([
|
|
2124
|
+
serialize()
|
|
2125
|
+
], Control.prototype, "paddingRight", null);
|
|
2126
|
+
__decorate([
|
|
2127
|
+
serialize()
|
|
2128
|
+
], Control.prototype, "paddingTop", null);
|
|
2129
|
+
__decorate([
|
|
2130
|
+
serialize()
|
|
2131
|
+
], Control.prototype, "paddingBottom", null);
|
|
2132
|
+
__decorate([
|
|
2133
|
+
serialize()
|
|
2134
|
+
], Control.prototype, "left", null);
|
|
2135
|
+
__decorate([
|
|
2136
|
+
serialize()
|
|
2137
|
+
], Control.prototype, "top", null);
|
|
2138
|
+
__decorate([
|
|
2139
|
+
serialize()
|
|
2140
|
+
], Control.prototype, "linkOffsetX", null);
|
|
2141
|
+
__decorate([
|
|
2142
|
+
serialize()
|
|
2143
|
+
], Control.prototype, "linkOffsetY", null);
|
|
2144
|
+
__decorate([
|
|
2145
|
+
serialize()
|
|
2146
|
+
], Control.prototype, "isEnabled", null);
|
|
2147
|
+
__decorate([
|
|
2148
|
+
serialize()
|
|
2149
|
+
], Control.prototype, "disabledColor", null);
|
|
2150
|
+
__decorate([
|
|
2151
|
+
serialize()
|
|
2152
|
+
], Control.prototype, "disabledColorItem", null);
|
|
2153
|
+
__decorate([
|
|
2154
|
+
serialize()
|
|
2155
|
+
], Control.prototype, "overlapGroup", void 0);
|
|
2156
|
+
__decorate([
|
|
2157
|
+
serialize()
|
|
2158
|
+
], Control.prototype, "overlapDeltaMultiplier", void 0);
|
|
2445
2159
|
RegisterClass("BABYLON.GUI.Control", Control);
|
|
2446
2160
|
//# sourceMappingURL=control.js.map
|