@babylonjs/gui 7.32.0 → 7.32.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,34 @@
1
+ import type { FrameGraphTextureHandle, FrameGraph } from "@babylonjs/core/index.js";
2
+ import { AdvancedDynamicTexture } from "../advancedDynamicTexture";
3
+ import { FrameGraphTask } from "@babylonjs/core/FrameGraph/frameGraphTask.js";
4
+ /**
5
+ * Task that renders a GUI texture.
6
+ */
7
+ export declare class FrameGraphGUITask extends FrameGraphTask {
8
+ /**
9
+ * The destination texture to render the GUI to.
10
+ */
11
+ destinationTexture: FrameGraphTextureHandle;
12
+ /**
13
+ * The output texture of the task.
14
+ * This is the same texture as the destination texture, but the handles are different!
15
+ */
16
+ readonly outputTexture: FrameGraphTextureHandle;
17
+ get disabled(): boolean;
18
+ set disabled(value: boolean);
19
+ /**
20
+ * Gets the underlying advanced dynamic texture.
21
+ */
22
+ get gui(): AdvancedDynamicTexture;
23
+ protected _adt: AdvancedDynamicTexture;
24
+ /**
25
+ * Constructs a new GUI task.
26
+ * @param name Name of the task
27
+ * @param frameGraph Frame graph the task belongs to
28
+ * @param adt The GUI texture. If not provided, a new fullscreen GUI will be created.
29
+ */
30
+ constructor(name: string, frameGraph: FrameGraph, adt?: AdvancedDynamicTexture);
31
+ isReady(): boolean;
32
+ record(): void;
33
+ dispose(): void;
34
+ }
@@ -0,0 +1,62 @@
1
+ import { AdvancedDynamicTexture } from "../advancedDynamicTexture.js";
2
+ import { FrameGraphTask } from "@babylonjs/core/FrameGraph/frameGraphTask.js";
3
+ /**
4
+ * Task that renders a GUI texture.
5
+ */
6
+ export class FrameGraphGUITask extends FrameGraphTask {
7
+ get disabled() {
8
+ return this._disabled;
9
+ }
10
+ set disabled(value) {
11
+ this._disabled = value;
12
+ this._adt.disablePicking = value;
13
+ }
14
+ /**
15
+ * Gets the underlying advanced dynamic texture.
16
+ */
17
+ get gui() {
18
+ return this._adt;
19
+ }
20
+ /**
21
+ * Constructs a new GUI task.
22
+ * @param name Name of the task
23
+ * @param frameGraph Frame graph the task belongs to
24
+ * @param adt The GUI texture. If not provided, a new fullscreen GUI will be created.
25
+ */
26
+ constructor(name, frameGraph, adt) {
27
+ super(name, frameGraph);
28
+ if (adt) {
29
+ if (!adt.useStandalone) {
30
+ throw new Error(`AdvancedDynamicTexture "${name}": the texture must have been created with the useStandalone property set to true`);
31
+ }
32
+ }
33
+ else {
34
+ adt = AdvancedDynamicTexture.CreateFullscreenUI(name, undefined, { useStandalone: true });
35
+ }
36
+ this._adt = adt;
37
+ this.outputTexture = this._frameGraph.createDanglingHandle();
38
+ }
39
+ isReady() {
40
+ return this._adt.guiIsReady() && this._adt._layerToDispose.isReady();
41
+ }
42
+ record() {
43
+ if (this.destinationTexture === undefined) {
44
+ throw new Error("FrameGraphGUITask: destinationTexture is required");
45
+ }
46
+ this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
47
+ const pass = this._frameGraph.addRenderPass(this.name);
48
+ pass.setRenderTarget(this.outputTexture);
49
+ pass.setExecuteFunc((context) => {
50
+ this._adt._checkUpdate(null);
51
+ context.render(this._adt._layerToDispose);
52
+ });
53
+ const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
54
+ passDisabled.setRenderTarget(this.outputTexture);
55
+ passDisabled.setExecuteFunc((_context) => { });
56
+ }
57
+ dispose() {
58
+ this._adt.dispose();
59
+ super.dispose();
60
+ }
61
+ }
62
+ //# sourceMappingURL=guiTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guiTask.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/FrameGraph/guiTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,qDAAuC;AAEhE;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IAYjD,IAAoB,QAAQ;QACxB,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,IAAoB,Q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AAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAC7B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,eAAgB,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACpB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\r\nimport { FrameGraphTask } from \"core/FrameGraph/frameGraphTask\";\r\n\r\n/**\r\n * Task that renders a GUI texture.\r\n */\r\nexport class FrameGraphGUITask extends FrameGraphTask {\r\n /**\r\n * The destination texture to render the GUI to.\r\n */\r\n public destinationTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture of the task.\r\n * This is the same texture as the destination texture, but the handles are different!\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n public override get disabled() {\r\n return this._disabled;\r\n }\r\n\r\n public override set disabled(value: boolean) {\r\n this._disabled = value;\r\n this._adt.disablePicking = value;\r\n }\r\n\r\n /**\r\n * Gets the underlying advanced dynamic texture.\r\n */\r\n public get gui() {\r\n return this._adt;\r\n }\r\n\r\n protected _adt: AdvancedDynamicTexture;\r\n\r\n /**\r\n * Constructs a new GUI task.\r\n * @param name Name of the task\r\n * @param frameGraph Frame graph the task belongs to\r\n * @param adt The GUI texture. If not provided, a new fullscreen GUI will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, adt?: AdvancedDynamicTexture) {\r\n super(name, frameGraph);\r\n\r\n if (adt) {\r\n if (!adt.useStandalone) {\r\n throw new Error(`AdvancedDynamicTexture \"${name}\": the texture must have been created with the useStandalone property set to true`);\r\n }\r\n } else {\r\n adt = AdvancedDynamicTexture.CreateFullscreenUI(name, undefined, { useStandalone: true });\r\n }\r\n this._adt = adt;\r\n\r\n this.outputTexture = this._frameGraph.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this._adt.guiIsReady() && this._adt._layerToDispose!.isReady();\r\n }\r\n\r\n public record(): void {\r\n if (this.destinationTexture === undefined) {\r\n throw new Error(\"FrameGraphGUITask: destinationTexture is required\");\r\n }\r\n\r\n this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setExecuteFunc((context) => {\r\n this._adt._checkUpdate(null);\r\n context.render(this._adt._layerToDispose!);\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n\r\n public override dispose(): void {\r\n this._adt.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
@@ -0,0 +1,43 @@
1
+ import { NodeRenderGraphBlock } from "@babylonjs/core/FrameGraph/Node/nodeRenderGraphBlock.js";
2
+ import { AdvancedDynamicTexture } from "../advancedDynamicTexture";
3
+ import type { Scene } from "@babylonjs/core/scene.js";
4
+ import type { NodeRenderGraphConnectionPoint } from "@babylonjs/core/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js";
5
+ import type { NodeRenderGraphBuildState } from "@babylonjs/core/FrameGraph/Node/nodeRenderGraphBuildState.js";
6
+ import { FrameGraphGUITask } from "./guiTask";
7
+ import type { FrameGraph } from "@babylonjs/core/FrameGraph/frameGraph.js";
8
+ /**
9
+ * Block that implements a fullscreen GUI for render graph
10
+ */
11
+ export declare class NodeRenderGraphGUIBlock extends NodeRenderGraphBlock {
12
+ protected _frameGraphTask: FrameGraphGUITask;
13
+ protected _gui: AdvancedDynamicTexture;
14
+ /**
15
+ * Gets the frame graph task associated with this block
16
+ */
17
+ get task(): FrameGraphGUITask;
18
+ /**
19
+ * Gets the GUI texture used by this block
20
+ */
21
+ get gui(): AdvancedDynamicTexture;
22
+ /**
23
+ * Create a new NodeRenderGraphGUIBlock
24
+ * @param name defines the block name
25
+ * @param frameGraph defines the hosting frame graph
26
+ * @param scene defines the hosting scene
27
+ */
28
+ constructor(name: string, frameGraph: FrameGraph, scene: Scene);
29
+ /**
30
+ * Gets the current class name
31
+ * @returns the class name
32
+ */
33
+ getClassName(): string;
34
+ /**
35
+ * Gets the destination input component
36
+ */
37
+ get destination(): NodeRenderGraphConnectionPoint;
38
+ /**
39
+ * Gets the output component
40
+ */
41
+ get output(): NodeRenderGraphConnectionPoint;
42
+ protected _buildBlock(state: NodeRenderGraphBuildState): void;
43
+ }
@@ -0,0 +1,69 @@
1
+ import { NodeRenderGraphBlock } from "@babylonjs/core/FrameGraph/Node/nodeRenderGraphBlock.js";
2
+ import { AdvancedDynamicTexture } from "../advancedDynamicTexture.js";
3
+ import { NodeRenderGraphBlockConnectionPointTypes } from "@babylonjs/core/FrameGraph/Node/Types/nodeRenderGraphTypes.js";
4
+ import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
5
+ import { FrameGraphGUITask } from "./guiTask.js";
6
+ /**
7
+ * Block that implements a fullscreen GUI for render graph
8
+ */
9
+ export class NodeRenderGraphGUIBlock extends NodeRenderGraphBlock {
10
+ /**
11
+ * Gets the frame graph task associated with this block
12
+ */
13
+ get task() {
14
+ return this._frameGraphTask;
15
+ }
16
+ /**
17
+ * Gets the GUI texture used by this block
18
+ */
19
+ get gui() {
20
+ return this._frameGraphTask.gui;
21
+ }
22
+ /**
23
+ * Create a new NodeRenderGraphGUIBlock
24
+ * @param name defines the block name
25
+ * @param frameGraph defines the hosting frame graph
26
+ * @param scene defines the hosting scene
27
+ */
28
+ constructor(name, frameGraph, scene) {
29
+ super(name, frameGraph, scene);
30
+ this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture);
31
+ this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
32
+ this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
33
+ this.output._typeConnectionSource = this.destination;
34
+ this._gui = AdvancedDynamicTexture.CreateFullscreenUI(this.name, undefined, {
35
+ useStandalone: true,
36
+ });
37
+ this._frameGraphTask = new FrameGraphGUITask(this.name, frameGraph, this._gui);
38
+ }
39
+ /**
40
+ * Gets the current class name
41
+ * @returns the class name
42
+ */
43
+ getClassName() {
44
+ return "GUI.NodeRenderGraphGUIBlock";
45
+ }
46
+ /**
47
+ * Gets the destination input component
48
+ */
49
+ get destination() {
50
+ return this._inputs[0];
51
+ }
52
+ /**
53
+ * Gets the output component
54
+ */
55
+ get output() {
56
+ return this._outputs[0];
57
+ }
58
+ _buildBlock(state) {
59
+ super._buildBlock(state);
60
+ this._frameGraphTask.name = this.name;
61
+ this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
62
+ const destinationConnectedPoint = this.destination.connectedPoint;
63
+ if (destinationConnectedPoint) {
64
+ this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
65
+ }
66
+ }
67
+ }
68
+ RegisterClass("BABYLON.GUI.NodeRenderGraphGUIBlock", NodeRenderGraphGUIBlock);
69
+ //# sourceMappingURL=renderGraphGUIBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderGraphGUIBlock.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/FrameGraph/renderGraphGUIBlock.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W,WAAW;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAEkB,WAAW,CAAC,KAAgC;QAC3D,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,CAAC,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEtC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,+EAA+E;QAEvI,MAAM,yBAAyB,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;QAClE,IAAI,yBAAyB,EAAE;YAC3B,IAAI,CAAC,eAAe,CAAC,kBAAkB,GAAG,yBAAyB,CAAC,KAAgC,CAAC;SACxG;IACL,CAAC;CACJ;AAED,aAAa,CAAC,qCAAqC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { NodeRenderGraphBlock } from \"core/FrameGraph/Node/nodeRenderGraphBlock\";\r\nimport { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"core/FrameGraph/Node/Types/nodeRenderGraphTypes\";\r\nimport type { NodeRenderGraphConnectionPoint } from \"core/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint\";\r\nimport type { NodeRenderGraphBuildState } from \"core/FrameGraph/Node/nodeRenderGraphBuildState\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { FrameGraphTextureHandle } from \"core/FrameGraph/frameGraphTypes\";\r\nimport { FrameGraphGUITask } from \"./guiTask\";\r\nimport type { FrameGraph } from \"core/FrameGraph/frameGraph\";\r\n\r\n/**\r\n * Block that implements a fullscreen GUI for render graph\r\n */\r\nexport class NodeRenderGraphGUIBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphGUITask;\r\n protected _gui: AdvancedDynamicTexture;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Gets the GUI texture used by this block\r\n */\r\n public get gui() {\r\n return this._frameGraphTask.gui;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphGUIBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = this.destination;\r\n\r\n this._gui = AdvancedDynamicTexture.CreateFullscreenUI(this.name, undefined, {\r\n useStandalone: true,\r\n });\r\n this._frameGraphTask = new FrameGraphGUITask(this.name, frameGraph, this._gui);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GUI.NodeRenderGraphGUIBlock\";\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.name = this.name;\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.NodeRenderGraphGUIBlock\", NodeRenderGraphGUIBlock);\r\n"]}
@@ -4,6 +4,8 @@ import type { Matrix } from "@babylonjs/core/Maths/math.vector.js";
4
4
  import { Vector2, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
5
5
  import type { PointerInfoPre } from "@babylonjs/core/Events/pointerEvents.js";
6
6
  import { ClipboardInfo } from "@babylonjs/core/Events/clipboardEvents.js";
7
+ import type { Camera } from "@babylonjs/core/Cameras/camera.js";
8
+ import type { IDynamicTextureOptions } from "@babylonjs/core/Materials/Textures/dynamicTexture.js";
7
9
  import { DynamicTexture } from "@babylonjs/core/Materials/Textures/dynamicTexture.js";
8
10
  import type { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
9
11
  import { Layer } from "@babylonjs/core/Layers/layer.js";
@@ -12,6 +14,18 @@ import { Container } from "./controls/container";
12
14
  import { Control } from "./controls/control";
13
15
  import { Style } from "./style";
14
16
  import { Viewport } from "@babylonjs/core/Maths/math.viewport.js";
17
+ /**
18
+ * Interface used to define options to create an AdvancedDynamicTexture
19
+ */
20
+ export interface IAdvancedDynamicTextureOptions extends IDynamicTextureOptions {
21
+ /**
22
+ * Indicates whether the ADT will be used autonomously. In this mode:
23
+ * - _checkUpdate() is not called
24
+ * - the layer is not rendered (so, the ADT is not visible)
25
+ * It's up to the user to perform the required calls manually to update the ADT.
26
+ */
27
+ useStandalone?: boolean;
28
+ }
15
29
  /**
16
30
  * Class used to create texture to support 2D GUI elements
17
31
  * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui
@@ -21,6 +35,8 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
21
35
  static SnippetUrl: string;
22
36
  /** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */
23
37
  static AllowGPUOptimizations: boolean;
38
+ /** Indicates whether the ADT is used autonomously */
39
+ readonly useStandalone: boolean;
24
40
  /** Snippet ID if the content was created from the snippet server */
25
41
  snippetId: string;
26
42
  /** Observable that fires when the GUI is ready */
@@ -125,6 +141,10 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
125
141
  * Defaults to false.
126
142
  */
127
143
  disableTabNavigation: boolean;
144
+ /**
145
+ * A boolean indicating whether controls can be picked/clicked on or not. Defaults to false.
146
+ */
147
+ disablePicking: boolean;
128
148
  /**
129
149
  * If set to true, the POINTERTAP event type will be used for "click", instead of POINTERUP
130
150
  */
@@ -234,13 +254,9 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
234
254
  /**
235
255
  * Creates a new AdvancedDynamicTexture
236
256
  * @param name defines the name of the texture
237
- * @param width defines the width of the texture
238
- * @param height defines the height of the texture
239
- * @param scene defines the hosting scene
240
- * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
241
- * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
242
- * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
257
+ * @param options The options to be used when constructing the ADT
243
258
  */
259
+ constructor(name: string, options?: IAdvancedDynamicTextureOptions);
244
260
  constructor(name: string, width?: number, height?: number, scene?: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number, invertY?: boolean);
245
261
  /**
246
262
  * Get the current class name of the texture useful for serialization or dynamic coding.
@@ -319,7 +335,8 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
319
335
  * @returns the projected position with Z
320
336
  */
321
337
  getProjectedPositionWithZ(position: Vector3, worldMatrix: Matrix): Vector3;
322
- private _checkUpdate;
338
+ /** @internal */
339
+ _checkUpdate(camera: Nullable<Camera>, skipUpdate?: boolean): void;
323
340
  private _clearMeasure;
324
341
  private _render;
325
342
  /**
@@ -497,12 +514,12 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
497
514
  * LayerMask is set through advancedTexture.layer.layerMask
498
515
  * @param name defines name for the texture
499
516
  * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
500
- * @param scene defines the hosting scene
517
+ * @param sceneOrOptions defines the hosting scene or options (IAdvancedDynamicTextureOptions)
501
518
  * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
502
519
  * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)
503
520
  * @returns a new AdvancedDynamicTexture
504
521
  */
505
- static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number, adaptiveScaling?: boolean): AdvancedDynamicTexture;
522
+ static CreateFullscreenUI(name: string, foreground?: boolean, sceneOrOptions?: Nullable<Scene> | IAdvancedDynamicTextureOptions, sampling?: number, adaptiveScaling?: boolean): AdvancedDynamicTexture;
506
523
  /**
507
524
  * Scales the texture
508
525
  * @param ratio the scale factor to apply to both width and height
@@ -236,18 +236,14 @@ export class AdvancedDynamicTexture extends DynamicTexture {
236
236
  set clipboardData(value) {
237
237
  this._clipboardData = value;
238
238
  }
239
- /**
240
- * Creates a new AdvancedDynamicTexture
241
- * @param name defines the name of the texture
242
- * @param width defines the width of the texture
243
- * @param height defines the height of the texture
244
- * @param scene defines the hosting scene
245
- * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
246
- * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
247
- * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
248
- */
249
- constructor(name, width = 0, height = 0, scene, generateMipMaps = false, samplingMode = Texture.NEAREST_SAMPLINGMODE, invertY = true) {
250
- super(name, { width: width, height: height }, scene, generateMipMaps, samplingMode, Constants.TEXTUREFORMAT_RGBA, invertY);
239
+ /** @internal */
240
+ constructor(name, widthOrOptions, _height = 0, scene, generateMipMaps = false, samplingMode = Texture.NEAREST_SAMPLINGMODE, invertY = true) {
241
+ widthOrOptions = widthOrOptions ?? 0;
242
+ const width = typeof widthOrOptions === "object" && widthOrOptions !== undefined ? (widthOrOptions.width ?? 0) : (widthOrOptions ?? 0);
243
+ const height = typeof widthOrOptions === "object" && widthOrOptions !== undefined ? (widthOrOptions.height ?? 0) : _height;
244
+ super(name, { width, height }, typeof widthOrOptions === "object" && widthOrOptions !== undefined ? widthOrOptions : scene, generateMipMaps, samplingMode, Constants.TEXTUREFORMAT_RGBA, invertY);
245
+ /** Indicates whether the ADT is used autonomously */
246
+ this.useStandalone = false;
251
247
  /** Observable that fires when the GUI is ready */
252
248
  this.onGuiReadyObservable = new Observable();
253
249
  this._isDirty = false;
@@ -321,6 +317,10 @@ export class AdvancedDynamicTexture extends DynamicTexture {
321
317
  * Defaults to false.
322
318
  */
323
319
  this.disableTabNavigation = false;
320
+ /**
321
+ * A boolean indicating whether controls can be picked/clicked on or not. Defaults to false.
322
+ */
323
+ this.disablePicking = false;
324
324
  /**
325
325
  * If set to true, the POINTERTAP event type will be used for "click", instead of POINTERUP
326
326
  */
@@ -384,7 +384,11 @@ export class AdvancedDynamicTexture extends DynamicTexture {
384
384
  }
385
385
  this.applyYInversionOnUpdate = invertY;
386
386
  this._rootElement = scene.getEngine().getInputElement();
387
- this._renderObserver = scene.onBeforeCameraRenderObservable.add((camera) => this._checkUpdate(camera));
387
+ const adtOptions = widthOrOptions;
388
+ this.useStandalone = !!adtOptions?.useStandalone;
389
+ if (!this.useStandalone) {
390
+ this._renderObserver = scene.onBeforeCameraRenderObservable.add((camera) => this._checkUpdate(camera));
391
+ }
388
392
  /** Whenever a control is added or removed to the root, we have to recheck the camera projection as it can have changed */
389
393
  this._controlAddedObserver = this._rootContainer.onControlAddedObservable.add((control) => {
390
394
  if (control) {
@@ -675,8 +679,9 @@ export class AdvancedDynamicTexture extends DynamicTexture {
675
679
  const projectedPosition = Vector3.Project(position, worldMatrix, scene.getTransformMatrix(), globalViewport);
676
680
  return new Vector3(projectedPosition.x, projectedPosition.y, projectedPosition.z);
677
681
  }
682
+ /** @internal */
678
683
  _checkUpdate(camera, skipUpdate) {
679
- if (this._layerToDispose) {
684
+ if (this._layerToDispose && camera) {
680
685
  if ((camera.layerMask & this._layerToDispose.layerMask) === 0) {
681
686
  return;
682
687
  }
@@ -787,7 +792,7 @@ export class AdvancedDynamicTexture extends DynamicTexture {
787
792
  }
788
793
  _doPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
789
794
  const scene = this.getScene();
790
- if (!scene) {
795
+ if (!scene || this.disablePicking) {
791
796
  return;
792
797
  }
793
798
  const engine = scene.getEngine();
@@ -1412,19 +1417,26 @@ export class AdvancedDynamicTexture extends DynamicTexture {
1412
1417
  * LayerMask is set through advancedTexture.layer.layerMask
1413
1418
  * @param name defines name for the texture
1414
1419
  * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
1415
- * @param scene defines the hosting scene
1420
+ * @param sceneOrOptions defines the hosting scene or options (IAdvancedDynamicTextureOptions)
1416
1421
  * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
1417
1422
  * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)
1418
1423
  * @returns a new AdvancedDynamicTexture
1419
1424
  */
1420
- static CreateFullscreenUI(name, foreground = true, scene = null, sampling = Texture.BILINEAR_SAMPLINGMODE, adaptiveScaling = false) {
1421
- const result = new AdvancedDynamicTexture(name, 0, 0, scene, false, sampling);
1425
+ static CreateFullscreenUI(name, foreground = true, sceneOrOptions = null, sampling = Texture.BILINEAR_SAMPLINGMODE, adaptiveScaling = false) {
1426
+ const isScene = !sceneOrOptions || sceneOrOptions._isScene;
1427
+ const result = isScene
1428
+ ? new AdvancedDynamicTexture(name, 0, 0, sceneOrOptions, false, sampling)
1429
+ : new AdvancedDynamicTexture(name, sceneOrOptions);
1422
1430
  // Display
1423
1431
  const resultScene = result.getScene();
1424
1432
  const layer = new Layer(name + "_layer", null, resultScene, !foreground);
1425
1433
  layer.texture = result;
1426
1434
  result._layerToDispose = layer;
1427
1435
  result._isFullscreen = true;
1436
+ if (result.useStandalone) {
1437
+ // Make sure the layer is not rendered by the layer component!
1438
+ layer.layerMask = 0;
1439
+ }
1428
1440
  if (adaptiveScaling && resultScene) {
1429
1441
  const newScale = 1 / resultScene.getEngine().getHardwareScalingLevel();
1430
1442
  result._rootContainer.scaleX = newScale;
@@ -1 +1 @@
1
- {"version":3,"file":"advancedDynamicTexture.js","sourceRoot":"","sources":["../../../../dev/gui/src/2D/advancedDynamicTexture.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAElD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,6CAA+B;AACtE,OAAO,EAAE,KAAK,EAAE,sCAAwB;AAExC,OAAO,EAAE,iBAAiB,EAAE,gDAAkC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,kDAAoC;AAEjF,OAAO,EAAE,kBAAkB,EAAE,iDAAmC;AAEhE,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAC1D,OAAO,EAAE,cAAc,EAAE,6DAA+C;AAExE,OAAO,EAAE,KAAK,EAAE,wCAA0B;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,6CAA+B;AACnD,OAAO,EAAE,QAAQ,EAAE,+CAAiC;AACpD,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAElD,OAAO,EAAE,UAAU,EAAE,qCAAuB;AAC5C,OAAO,EAAE,QAAQ,EAAE,0CAA4B;AAC/C,OAAO,EAAE,oBAAoB,EAAE,4CAA8B;AAK7D;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,cAAc;IA6DtD,mFAAmF;IACnF,IAAW,cAAc;QACrB,OAAO,IAAI,CA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AC,CAAC;QACnB,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACa,OAAO,CAAC,KAAa,EAAE,MAAc;QACjD,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC7B,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IAEO,gBAAgB;QACpB,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE;YACnB,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAEhD,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC;SACrC;IACL,CAAC;IAED;;OAEG;IACI,UAAU;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;IACzC,CAAC;;AAlkDD,sCAAsC;AACxB,iCAAU,GAAG,SAAS,CAAC,UAAU,AAAvB,CAAwB;AAEhD,yIAAyI;AAC3H,4CAAqB,GAAG,IAAI,AAAP,CAAQ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport { Vector2, Vector3, TmpVectors } from \"core/Maths/math.vector\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport type { PointerInfoPre, PointerInfo, PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\nimport { ClipboardEventTypes, ClipboardInfo } from \"core/Events/clipboardEvents\";\r\nimport type { KeyboardInfoPre } from \"core/Events/keyboardEvents\";\r\nimport { KeyboardEventTypes } from \"core/Events/keyboardEvents\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { DynamicTexture } from \"core/Materials/Textures/dynamicTexture\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { Layer } from \"core/Layers/layer\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport { Container } from \"./controls/container\";\r\nimport { Control } from \"./controls/control\";\r\nimport { Style } from \"./style\";\r\nimport { Measure } from \"./measure\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { Viewport } from \"core/Maths/math.viewport\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { WebRequest } from \"core/Misc/webRequest\";\r\nimport type { IPointerEvent, IWheelEvent } from \"core/Events/deviceInputEvents\";\r\nimport { RandomGUID } from \"core/Misc/guid\";\r\nimport { GetClass } from \"core/Misc/typeStore\";\r\nimport { DecodeBase64ToBinary } from \"core/Misc/stringTools\";\r\n\r\nimport type { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport type { AbstractEngine } from \"core/Engines/abstractEngine\";\r\n\r\n/**\r\n * Class used to create texture to support 2D GUI elements\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui\r\n */\r\nexport class AdvancedDynamicTexture extends DynamicTexture {\r\n /** Define the url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */\r\n public static AllowGPUOptimizations = true;\r\n\r\n /** Snippet ID if the content was created from the snippet server */\r\n public snippetId: string;\r\n\r\n /** Observable that fires when the GUI is ready */\r\n public onGuiReadyObservable = new Observable<AdvancedDynamicTexture>();\r\n\r\n private _isDirty = false;\r\n private _renderObserver: Nullable<Observer<Camera>>;\r\n private _resizeObserver: Nullable<Observer<AbstractEngine>>;\r\n private _preKeyboardObserver: Nullable<Observer<KeyboardInfoPre>>;\r\n private _prePointerObserver: Nullable<Observer<PointerInfoPre>>;\r\n private _sceneRenderObserver: Nullable<Observer<Scene>>;\r\n private _pointerObserver: Nullable<Observer<PointerInfo>>;\r\n private _canvasPointerOutObserver: Nullable<Observer<PointerEvent>>;\r\n private _canvasBlurObserver: Nullable<Observer<AbstractEngine>>;\r\n private _controlAddedObserver: Nullable<Observer<Nullable<Control>>>;\r\n private _controlRemovedObserver: Nullable<Observer<Nullable<Control>>>;\r\n private _background: string;\r\n /** @internal */\r\n public _rootContainer = new Container(\"root\");\r\n /** @internal */\r\n public _lastPickedControl: Control;\r\n /** @internal */\r\n public _lastControlOver: { [pointerId: number]: Control } = {};\r\n /** @internal */\r\n public _lastControlDown: { [pointerId: number]: Control } = {};\r\n /** @internal */\r\n public _capturingControl: { [pointerId: number]: Control } = {};\r\n /** @internal */\r\n public _shouldBlockPointer: boolean;\r\n /** @internal */\r\n public _layerToDispose: Nullable<Layer>;\r\n /** @internal */\r\n public _linkedControls = new Array<Control>();\r\n /** @internal */\r\n public _isFullscreen = false;\r\n private _fullscreenViewport = new Viewport(0, 0, 1, 1);\r\n private _idealWidth = 0;\r\n private _idealHeight = 0;\r\n private _useSmallestIdeal: boolean = false;\r\n private _renderAtIdealSize = false;\r\n private _focusedControl: Nullable<Control>;\r\n private _blockNextFocusCheck = false;\r\n private _renderScale = 1;\r\n private _rootElement: Nullable<HTMLElement>;\r\n private _cursorChanged = false;\r\n private _defaultMousePointerId = 0;\r\n private _rootChildrenHaveChanged: boolean = false;\r\n\r\n /** @internal */\r\n public _capturedPointerIds = new Set<number>();\r\n\r\n /** @internal */\r\n public _numLayoutCalls = 0;\r\n /** Gets the number of layout calls made the last time the ADT has been rendered */\r\n public get numLayoutCalls(): number {\r\n return this._numLayoutCalls;\r\n }\r\n\r\n /** @internal */\r\n public _numRenderCalls = 0;\r\n /** Gets the number of render calls made the last time the ADT has been rendered */\r\n public get numRenderCalls(): number {\r\n return this._numRenderCalls;\r\n }\r\n\r\n /**\r\n * Define type to string to ensure compatibility across browsers\r\n * Safari doesn't support DataTransfer constructor\r\n */\r\n private _clipboardData: string = \"\";\r\n /**\r\n * Observable event triggered each time an clipboard event is received from the rendering canvas\r\n */\r\n public onClipboardObservable = new Observable<ClipboardInfo>();\r\n /**\r\n * Observable event triggered each time a pointer down is intercepted by a control\r\n */\r\n public onControlPickedObservable = new Observable<Control>();\r\n /**\r\n * Observable event triggered before layout is evaluated\r\n */\r\n public onBeginLayoutObservable = new Observable<AdvancedDynamicTexture>();\r\n /**\r\n * Observable event triggered after the layout was evaluated\r\n */\r\n public onEndLayoutObservable = new Observable<AdvancedDynamicTexture>();\r\n /**\r\n * Observable event triggered before the texture is rendered\r\n */\r\n public onBeginRenderObservable = new Observable<AdvancedDynamicTexture>();\r\n /**\r\n * Observable event triggered after the texture was rendered\r\n */\r\n public onEndRenderObservable = new Observable<AdvancedDynamicTexture>();\r\n /**\r\n * Gets or sets a boolean defining if alpha is stored as premultiplied\r\n */\r\n public premulAlpha = false;\r\n /**\r\n * Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture\r\n */\r\n public applyYInversionOnUpdate = true;\r\n\r\n /**\r\n * A boolean indicating whether or not the elements can be navigated to using the tab key.\r\n * Defaults to false.\r\n */\r\n public disableTabNavigation = false;\r\n\r\n /**\r\n * If set to true, the POINTERTAP event type will be used for \"click\", instead of POINTERUP\r\n */\r\n public usePointerTapForClickEvent = false;\r\n /**\r\n * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).\r\n * Useful when you want more antialiasing\r\n */\r\n public get renderScale(): number {\r\n return this._renderScale;\r\n }\r\n public set renderScale(value: number) {\r\n if (value === this._renderScale) {\r\n return;\r\n }\r\n this._renderScale = value;\r\n this._onResize();\r\n }\r\n /** Gets or sets the background color */\r\n public get background(): string {\r\n return this._background;\r\n }\r\n public set background(value: string) {\r\n if (this._background === value) {\r\n return;\r\n }\r\n this._background = value;\r\n this.markAsDirty();\r\n }\r\n /**\r\n * Gets or sets the ideal width used to design controls.\r\n * The GUI will then rescale everything accordingly\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling\r\n */\r\n public get idealWidth(): number {\r\n return this._idealWidth;\r\n }\r\n public set idealWidth(value: number) {\r\n if (this._idealWidth === value) {\r\n return;\r\n }\r\n this._idealWidth = value;\r\n this.markAsDirty();\r\n this._rootContainer._markAllAsDirty();\r\n }\r\n /**\r\n * Gets or sets the ideal height used to design controls.\r\n * The GUI will then rescale everything accordingly\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling\r\n */\r\n public get idealHeight(): number {\r\n return this._idealHeight;\r\n }\r\n public set idealHeight(value: number) {\r\n if (this._idealHeight === value) {\r\n return;\r\n }\r\n this._idealHeight = value;\r\n this.markAsDirty();\r\n this._rootContainer._markAllAsDirty();\r\n }\r\n /**\r\n * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling\r\n */\r\n public get useSmallestIdeal(): boolean {\r\n return this._useSmallestIdeal;\r\n }\r\n public set useSmallestIdeal(value: boolean) {\r\n if (this._useSmallestIdeal === value) {\r\n return;\r\n }\r\n this._useSmallestIdeal = value;\r\n this.markAsDirty();\r\n this._rootContainer._markAllAsDirty();\r\n }\r\n /**\r\n * Gets or sets a boolean indicating if adaptive scaling must be used\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling\r\n */\r\n public get renderAtIdealSize(): boolean {\r\n return this._renderAtIdealSize;\r\n }\r\n public set renderAtIdealSize(value: boolean) {\r\n if (this._renderAtIdealSize === value) {\r\n return;\r\n }\r\n this._renderAtIdealSize = value;\r\n this._onResize();\r\n }\r\n\r\n /**\r\n * Gets the ratio used when in \"ideal mode\"\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling\r\n * */\r\n public get idealRatio(): number {\r\n let rwidth: number = 0;\r\n let rheight: number = 0;\r\n\r\n if (this._idealWidth) {\r\n rwidth = this.getSize().width / this._idealWidth;\r\n }\r\n\r\n if (this._idealHeight) {\r\n rheight = this.getSize().height / this._idealHeight;\r\n }\r\n\r\n if (this._useSmallestIdeal && this._idealWidth && this._idealHeight) {\r\n return window.innerWidth < window.innerHeight ? rwidth : rheight;\r\n }\r\n\r\n if (this._idealWidth) {\r\n // horizontal\r\n return rwidth;\r\n }\r\n\r\n if (this._idealHeight) {\r\n // vertical\r\n return rheight;\r\n }\r\n\r\n return 1;\r\n }\r\n\r\n /**\r\n * Gets the underlying layer used to render the texture when in fullscreen mode\r\n */\r\n public get layer(): Nullable<Layer> {\r\n return this._layerToDispose;\r\n }\r\n /**\r\n * Gets the root container control\r\n */\r\n public get rootContainer(): Container {\r\n return this._rootContainer;\r\n }\r\n /**\r\n * Returns an array containing the root container.\r\n * This is mostly used to let the Inspector introspects the ADT\r\n * @returns an array containing the rootContainer\r\n */\r\n public getChildren(): Array<Container> {\r\n return [this._rootContainer];\r\n }\r\n /**\r\n * Will return all controls that are inside this texture\r\n * @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\r\n * @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\r\n * @returns all child controls\r\n */\r\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[] {\r\n return this._rootContainer.getDescendants(directDescendantsOnly, predicate);\r\n }\r\n\r\n /**\r\n * Will return all controls with the given type name\r\n * @param typeName defines the type name to search for\r\n * @returns an array of all controls found\r\n */\r\n public getControlsByType(typeName: string): Control[] {\r\n return this._rootContainer.getDescendants(false, (control) => control.typeName === typeName);\r\n }\r\n\r\n /**\r\n * Will return the first control with the given name\r\n * @param name defines the name to search for\r\n * @returns the first control found or null\r\n */\r\n public getControlByName(name: string): Nullable<Control> {\r\n return this._getControlByKey(\"name\", name);\r\n }\r\n\r\n private _getControlByKey(key: string, value: any): Nullable<Control> {\r\n return this._rootContainer.getDescendants().find((control) => control[key as keyof Control] === value) || null;\r\n }\r\n\r\n /**\r\n * Gets or sets the current focused control\r\n */\r\n public get focusedControl(): Nullable<Control> {\r\n return this._focusedControl;\r\n }\r\n public set focusedControl(control: Nullable<Control>) {\r\n if (this._focusedControl == control) {\r\n return;\r\n }\r\n if (this._focusedControl) {\r\n this._focusedControl.onBlur();\r\n }\r\n if (control) {\r\n control.onFocus();\r\n }\r\n this._focusedControl = control;\r\n }\r\n /**\r\n * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode\r\n */\r\n public get isForeground(): boolean {\r\n if (!this.layer) {\r\n return true;\r\n }\r\n return !this.layer.isBackground;\r\n }\r\n public set isForeground(value: boolean) {\r\n if (!this.layer) {\r\n return;\r\n }\r\n if (this.layer.isBackground === !value) {\r\n return;\r\n }\r\n this.layer.isBackground = !value;\r\n }\r\n /**\r\n * Gets or set information about clipboardData\r\n */\r\n public get clipboardData(): string {\r\n return this._clipboardData;\r\n }\r\n public set clipboardData(value: string) {\r\n this._clipboardData = value;\r\n }\r\n\r\n /**\r\n * If this is set, even when a control is pointer blocker, some events can still be passed through to the scene.\r\n * Options from values are PointerEventTypes\r\n * POINTERDOWN, POINTERUP, POINTERMOVE, POINTERWHEEL, POINTERPICK, POINTERTAP, POINTERDOUBLETAP\r\n */\r\n public skipBlockEvents = 0;\r\n\r\n /**\r\n * If set to true, every scene render will trigger a pointer event for the GUI\r\n * if it is linked to a mesh or has controls linked to a mesh. This will allow\r\n * you to catch the pointer moving around the GUI due to camera or mesh movements,\r\n * but it has a performance cost.\r\n */\r\n public checkPointerEveryFrame = false;\r\n /**\r\n * Creates a new AdvancedDynamicTexture\r\n * @param name defines the name of the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param scene defines the hosting scene\r\n * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)\r\n * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\r\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\r\n */\r\n constructor(name: string, width = 0, height = 0, scene?: Nullable<Scene>, generateMipMaps = false, samplingMode = Texture.NEAREST_SAMPLINGMODE, invertY = true) {\r\n super(name, { width: width, height: height }, scene, generateMipMaps, samplingMode, Constants.TEXTUREFORMAT_RGBA, invertY);\r\n scene = this.getScene();\r\n if (!scene || !this._texture) {\r\n return;\r\n }\r\n this.applyYInversionOnUpdate = invertY;\r\n this._rootElement = scene.getEngine().getInputElement();\r\n this._renderObserver = scene.onBeforeCameraRenderObservable.add((camera: Camera) => this._checkUpdate(camera));\r\n\r\n /** Whenever a control is added or removed to the root, we have to recheck the camera projection as it can have changed */\r\n this._controlAddedObserver = this._rootContainer.onControlAddedObservable.add((control) => {\r\n if (control) {\r\n this._rootChildrenHaveChanged = true;\r\n }\r\n });\r\n this._controlRemovedObserver = this._rootContainer.onControlRemovedObservable.add((control) => {\r\n if (control) {\r\n this._rootChildrenHaveChanged = true;\r\n }\r\n });\r\n this._preKeyboardObserver = scene.onPreKeyboardObservable.add((info) => {\r\n // check if tab is pressed\r\n if (!this.disableTabNavigation && info.type === KeyboardEventTypes.KEYDOWN && info.event.code === \"Tab\") {\r\n const forward = !info.event.shiftKey;\r\n if (\r\n (forward && this._focusProperties.index === this._focusProperties.total - 1) ||\r\n (!forward && this._focusProperties.index === 0 && this._focusProperties.total > 0)\r\n ) {\r\n this.focusedControl = null;\r\n this._focusProperties.index = 0;\r\n this._focusProperties.total = -1;\r\n return;\r\n }\r\n this._focusNextElement(forward);\r\n info.event.preventDefault();\r\n return;\r\n }\r\n if (!this._focusedControl) {\r\n return;\r\n }\r\n if (info.type === KeyboardEventTypes.KEYDOWN) {\r\n this._focusedControl.processKeyboard(info.event);\r\n }\r\n info.skipOnPointerObservable = true;\r\n });\r\n this._rootContainer._link(this);\r\n this.hasAlpha = true;\r\n if (!width || !height) {\r\n this._resizeObserver = scene.getEngine().onResizeObservable.add(() => this._onResize());\r\n this._onResize();\r\n }\r\n this._texture.isReady = true;\r\n }\r\n /**\r\n * Get the current class name of the texture useful for serialization or dynamic coding.\r\n * @returns \"AdvancedDynamicTexture\"\r\n */\r\n public override getClassName(): string {\r\n return \"AdvancedDynamicTexture\";\r\n }\r\n /**\r\n * Function used to execute a function on all controls\r\n * @param func defines the function to execute\r\n * @param container defines the container where controls belong. If null the root container will be used\r\n */\r\n public executeOnAllControls(func: (control: Control) => void, container?: Container) {\r\n if (!container) {\r\n container = this._rootContainer;\r\n }\r\n func(container);\r\n for (const child of container.children) {\r\n if ((<any>child).children) {\r\n this.executeOnAllControls(func, <Container>child);\r\n continue;\r\n }\r\n func(child);\r\n }\r\n }\r\n\r\n private _useInvalidateRectOptimization = true;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the InvalidateRect optimization should be turned on\r\n */\r\n public get useInvalidateRectOptimization(): boolean {\r\n return this._useInvalidateRectOptimization;\r\n }\r\n\r\n public set useInvalidateRectOptimization(value: boolean) {\r\n this._useInvalidateRectOptimization = value;\r\n }\r\n\r\n // Invalidated rectangle which is the combination of all invalidated controls after they have been rotated into absolute position\r\n private _invalidatedRectangle: Nullable<Measure> = null;\r\n /**\r\n * Invalidates a rectangle area on the gui texture\r\n * @param invalidMinX left most position of the rectangle to invalidate in the texture\r\n * @param invalidMinY top most position of the rectangle to invalidate in the texture\r\n * @param invalidMaxX right most position of the rectangle to invalidate in the texture\r\n * @param invalidMaxY bottom most position of the rectangle to invalidate in the texture\r\n */\r\n public invalidateRect(invalidMinX: number, invalidMinY: number, invalidMaxX: number, invalidMaxY: number) {\r\n if (!this._useInvalidateRectOptimization) {\r\n return;\r\n }\r\n if (!this._invalidatedRectangle) {\r\n this._invalidatedRectangle = new Measure(invalidMinX, invalidMinY, invalidMaxX - invalidMinX + 1, invalidMaxY - invalidMinY + 1);\r\n } else {\r\n // Compute intersection\r\n const maxX = Math.ceil(Math.max(this._invalidatedRectangle.left + this._invalidatedRectangle.width - 1, invalidMaxX));\r\n const maxY = Math.ceil(Math.max(this._invalidatedRectangle.top + this._invalidatedRectangle.height - 1, invalidMaxY));\r\n this._invalidatedRectangle.left = Math.floor(Math.min(this._invalidatedRectangle.left, invalidMinX));\r\n this._invalidatedRectangle.top = Math.floor(Math.min(this._invalidatedRectangle.top, invalidMinY));\r\n this._invalidatedRectangle.width = maxX - this._invalidatedRectangle.left + 1;\r\n this._invalidatedRectangle.height = maxY - this._invalidatedRectangle.top + 1;\r\n }\r\n }\r\n /**\r\n * Marks the texture as dirty forcing a complete update\r\n */\r\n public markAsDirty() {\r\n this._isDirty = true;\r\n }\r\n /**\r\n * Helper function used to create a new style\r\n * @returns a new style\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#styles\r\n */\r\n public createStyle(): Style {\r\n return new Style(this);\r\n }\r\n /**\r\n * Adds a new control to the root container\r\n * @param control defines the control to add\r\n * @returns the current texture\r\n */\r\n public addControl(control: Control): AdvancedDynamicTexture {\r\n this._rootContainer.addControl(control);\r\n return this;\r\n }\r\n /**\r\n * Removes a control from the root container\r\n * @param control defines the control to remove\r\n * @returns the current texture\r\n */\r\n public removeControl(control: Control): AdvancedDynamicTexture {\r\n this._rootContainer.removeControl(control);\r\n return this;\r\n }\r\n /**\r\n * Moves overlapped controls towards a position where it is not overlapping anymore.\r\n * Please note that this method alters linkOffsetXInPixels and linkOffsetYInPixels.\r\n * @param overlapGroup the overlap group which will be processed or undefined to process all overlap groups\r\n * @param deltaStep the step size (speed) to reach the target non overlapping position (default 0.1)\r\n * @param repelFactor how much is the control repelled by other controls\r\n */\r\n public moveToNonOverlappedPosition(overlapGroup?: number | Control[], deltaStep = 1, repelFactor = 1) {\r\n let controlsForGroup: Control[];\r\n if (Array.isArray(overlapGroup)) {\r\n controlsForGroup = overlapGroup;\r\n } else {\r\n const descendants = this.getDescendants(true);\r\n // get only the controls with an overlapGroup property set\r\n // if the overlapGroup parameter is set, filter the controls and get only the controls belonging to that overlapGroup\r\n controlsForGroup = overlapGroup === undefined ? descendants.filter((c) => c.overlapGroup !== undefined) : descendants.filter((c) => c.overlapGroup === overlapGroup);\r\n }\r\n\r\n controlsForGroup.forEach((control1) => {\r\n let velocity = Vector2.Zero();\r\n const center = new Vector2(control1.centerX, control1.centerY);\r\n\r\n controlsForGroup.forEach((control2) => {\r\n if (control1 !== control2 && AdvancedDynamicTexture._Overlaps(control1, control2)) {\r\n // if the two controls overlaps get a direction vector from one control's center to another control's center\r\n const diff = center.subtract(new Vector2(control2.centerX, control2.centerY));\r\n const diffLength = diff.length();\r\n\r\n if (diffLength > 0) {\r\n // calculate the velocity\r\n velocity = velocity.add(diff.normalize().scale(repelFactor / diffLength));\r\n }\r\n }\r\n });\r\n\r\n if (velocity.length() > 0) {\r\n // move the control along the direction vector away from the overlapping control\r\n velocity = velocity.normalize().scale(deltaStep * (control1.overlapDeltaMultiplier ?? 1));\r\n control1.linkOffsetXInPixels += velocity.x;\r\n control1.linkOffsetYInPixels += velocity.y;\r\n }\r\n });\r\n }\r\n /**\r\n * Release all resources\r\n */\r\n public override dispose(): void {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n this._rootElement = null;\r\n scene.onBeforeCameraRenderObservable.remove(this._renderObserver);\r\n if (this._resizeObserver) {\r\n scene.getEngine().onResizeObservable.remove(this._resizeObserver);\r\n }\r\n if (this._prePointerObserver) {\r\n scene.onPrePointerObservable.remove(this._prePointerObserver);\r\n }\r\n if (this._sceneRenderObserver) {\r\n scene.onBeforeRenderObservable.remove(this._sceneRenderObserver);\r\n }\r\n if (this._pointerObserver) {\r\n scene.onPointerObservable.remove(this._pointerObserver);\r\n }\r\n if (this._preKeyboardObserver) {\r\n scene.onPreKeyboardObservable.remove(this._preKeyboardObserver);\r\n }\r\n if (this._canvasPointerOutObserver) {\r\n scene.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver);\r\n }\r\n if (this._canvasBlurObserver) {\r\n scene.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver);\r\n }\r\n if (this._controlAddedObserver) {\r\n this._rootContainer.onControlAddedObservable.remove(this._controlAddedObserver);\r\n }\r\n if (this._controlRemovedObserver) {\r\n this._rootContainer.onControlRemovedObservable.remove(this._controlRemovedObserver);\r\n }\r\n if (this._layerToDispose) {\r\n this._layerToDispose.texture = null;\r\n this._layerToDispose.dispose();\r\n this._layerToDispose = null;\r\n }\r\n this._rootContainer.dispose();\r\n this.onClipboardObservable.clear();\r\n this.onControlPickedObservable.clear();\r\n this.onBeginRenderObservable.clear();\r\n this.onEndRenderObservable.clear();\r\n this.onBeginLayoutObservable.clear();\r\n this.onEndLayoutObservable.clear();\r\n this.onGuiReadyObservable.clear();\r\n super.dispose();\r\n }\r\n private _onResize(): void {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n // Check size\r\n const engine = scene.getEngine();\r\n const textureSize = this.getSize();\r\n let renderWidth = engine.getRenderWidth() * this._renderScale;\r\n let renderHeight = engine.getRenderHeight() * this._renderScale;\r\n\r\n if (this._renderAtIdealSize) {\r\n if (this._idealWidth) {\r\n renderHeight = (renderHeight * this._idealWidth) / renderWidth;\r\n renderWidth = this._idealWidth;\r\n } else if (this._idealHeight) {\r\n renderWidth = (renderWidth * this._idealHeight) / renderHeight;\r\n renderHeight = this._idealHeight;\r\n }\r\n }\r\n if (textureSize.width !== renderWidth || textureSize.height !== renderHeight) {\r\n this.scaleTo(renderWidth, renderHeight);\r\n this.markAsDirty();\r\n if (this._idealWidth || this._idealHeight) {\r\n this._rootContainer._markAllAsDirty();\r\n }\r\n }\r\n this.invalidateRect(0, 0, textureSize.width - 1, textureSize.height - 1);\r\n }\r\n /** @internal */\r\n public _getGlobalViewport(): Viewport {\r\n const size = this.getSize();\r\n const globalViewPort = this._fullscreenViewport.toGlobal(size.width, size.height);\r\n\r\n const targetX = Math.round(globalViewPort.width * (1 / this.rootContainer.scaleX));\r\n const targetY = Math.round(globalViewPort.height * (1 / this.rootContainer.scaleY));\r\n\r\n globalViewPort.x += (globalViewPort.width - targetX) / 2;\r\n globalViewPort.y += (globalViewPort.height - targetY) / 2;\r\n\r\n globalViewPort.width = targetX;\r\n globalViewPort.height = targetY;\r\n\r\n return globalViewPort;\r\n }\r\n /**\r\n * Get screen coordinates for a vector3\r\n * @param position defines the position to project\r\n * @param worldMatrix defines the world matrix to use\r\n * @returns the projected position\r\n */\r\n public getProjectedPosition(position: Vector3, worldMatrix: Matrix): Vector2 {\r\n const result = this.getProjectedPositionWithZ(position, worldMatrix);\r\n return new Vector2(result.x, result.y);\r\n }\r\n\r\n /**\r\n * Get screen coordinates for a vector3\r\n * @param position defines the position to project\r\n * @param worldMatrix defines the world matrix to use\r\n * @returns the projected position with Z\r\n */\r\n public getProjectedPositionWithZ(position: Vector3, worldMatrix: Matrix): Vector3 {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return Vector3.Zero();\r\n }\r\n const globalViewport = this._getGlobalViewport();\r\n const projectedPosition = Vector3.Project(position, worldMatrix, scene.getTransformMatrix(), globalViewport);\r\n return new Vector3(projectedPosition.x, projectedPosition.y, projectedPosition.z);\r\n }\r\n\r\n private _checkUpdate(camera: Camera, skipUpdate?: boolean): void {\r\n if (this._layerToDispose) {\r\n if ((camera.layerMask & this._layerToDispose.layerMask) === 0) {\r\n return;\r\n }\r\n }\r\n if (this._isFullscreen && this._linkedControls.length) {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n const globalViewport = this._getGlobalViewport();\r\n for (const control of this._linkedControls) {\r\n if (!control.isVisible) {\r\n continue;\r\n }\r\n const mesh = control._linkedMesh as AbstractMesh;\r\n if (!mesh || mesh.isDisposed()) {\r\n Tools.SetImmediate(() => {\r\n control.linkWithMesh(null);\r\n });\r\n continue;\r\n }\r\n const position = mesh.getBoundingInfo ? mesh.getBoundingInfo().boundingSphere.center : (Vector3.ZeroReadOnly as Vector3);\r\n const projectedPosition = Vector3.Project(position, mesh.getWorldMatrix(), scene.getTransformMatrix(), globalViewport);\r\n if (projectedPosition.z < 0 || projectedPosition.z > 1) {\r\n control.notRenderable = true;\r\n continue;\r\n }\r\n control.notRenderable = false;\r\n if (this.useInvalidateRectOptimization) {\r\n control.invalidateRect();\r\n }\r\n\r\n control._moveToProjectedPosition(projectedPosition);\r\n }\r\n }\r\n if (!this._isDirty && !this._rootContainer.isDirty) {\r\n return;\r\n }\r\n this._isDirty = false;\r\n this._render(skipUpdate);\r\n if (!skipUpdate) {\r\n this.update(this.applyYInversionOnUpdate, this.premulAlpha, AdvancedDynamicTexture.AllowGPUOptimizations);\r\n }\r\n }\r\n\r\n private _clearMeasure = new Measure(0, 0, 0, 0);\r\n\r\n private _render(skipRender?: boolean): void {\r\n const textureSize = this.getSize();\r\n const renderWidth = textureSize.width;\r\n const renderHeight = textureSize.height;\r\n\r\n const context = this.getContext();\r\n context.font = \"18px Arial\";\r\n context.strokeStyle = \"white\";\r\n\r\n if (this.onGuiReadyObservable.hasObservers()) {\r\n this._checkGuiIsReady();\r\n }\r\n\r\n /** We have to recheck the camera projection in the case the root control's children have changed */\r\n if (this._rootChildrenHaveChanged) {\r\n const camera = this.getScene()?.activeCamera;\r\n if (camera) {\r\n this._rootChildrenHaveChanged = false;\r\n this._checkUpdate(camera, true);\r\n }\r\n }\r\n\r\n // Layout\r\n this.onBeginLayoutObservable.notifyObservers(this);\r\n const measure = new Measure(0, 0, renderWidth, renderHeight);\r\n this._numLayoutCalls = 0;\r\n this._rootContainer._layout(measure, context);\r\n this.onEndLayoutObservable.notifyObservers(this);\r\n this._isDirty = false; // Restoring the dirty state that could have been set by controls during layout processing\r\n\r\n if (skipRender) {\r\n return;\r\n }\r\n\r\n // Clear\r\n if (this._invalidatedRectangle) {\r\n this._clearMeasure.copyFrom(this._invalidatedRectangle);\r\n } else {\r\n this._clearMeasure.copyFromFloats(0, 0, renderWidth, renderHeight);\r\n }\r\n context.clearRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);\r\n if (this._background) {\r\n context.save();\r\n context.fillStyle = this._background;\r\n context.fillRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);\r\n context.restore();\r\n }\r\n\r\n // Render\r\n this.onBeginRenderObservable.notifyObservers(this);\r\n this._numRenderCalls = 0;\r\n this._rootContainer._render(context, this._invalidatedRectangle);\r\n this.onEndRenderObservable.notifyObservers(this);\r\n this._invalidatedRectangle = null;\r\n }\r\n /**\r\n * @internal\r\n */\r\n public _changeCursor(cursor: string) {\r\n if (this._rootElement) {\r\n this._rootElement.style.cursor = cursor;\r\n this._cursorChanged = true;\r\n }\r\n }\r\n /**\r\n * @internal\r\n */\r\n public _registerLastControlDown(control: Control, pointerId: number) {\r\n this._lastControlDown[pointerId] = control;\r\n this.onControlPickedObservable.notifyObservers(control);\r\n }\r\n private _doPicking(x: number, y: number, pi: Nullable<PointerInfoBase>, type: number, pointerId: number, buttonIndex: number, deltaX?: number, deltaY?: number): void {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n const engine = scene.getEngine();\r\n const textureSize = this.getSize();\r\n if (this._isFullscreen) {\r\n const camera = scene.cameraToUseForPointers || scene.activeCamera;\r\n if (!camera) {\r\n return;\r\n }\r\n const viewport = camera.viewport;\r\n x = x * (textureSize.width / (engine.getRenderWidth() * viewport.width));\r\n y = y * (textureSize.height / (engine.getRenderHeight() * viewport.height));\r\n }\r\n if (this._capturingControl[pointerId]) {\r\n if (this._capturingControl[pointerId].isPointerBlocker) {\r\n this._shouldBlockPointer = true;\r\n }\r\n this._capturingControl[pointerId]._processObservables(type, x, y, pi, pointerId, buttonIndex);\r\n return;\r\n }\r\n\r\n this._cursorChanged = false;\r\n if (!this._rootContainer._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) {\r\n if (!scene.doNotHandleCursors) {\r\n this._changeCursor(\"\");\r\n }\r\n if (type === PointerEventTypes.POINTERMOVE) {\r\n if (this._lastControlOver[pointerId]) {\r\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi);\r\n delete this._lastControlOver[pointerId];\r\n }\r\n }\r\n }\r\n\r\n if (!this._cursorChanged && !scene.doNotHandleCursors) {\r\n this._changeCursor(\"\");\r\n }\r\n this._manageFocus();\r\n }\r\n /**\r\n * @internal\r\n */\r\n public _cleanControlAfterRemovalFromList(list: { [pointerId: number]: Control }, control: Control) {\r\n for (const pointerId in list) {\r\n if (!Object.prototype.hasOwnProperty.call(list, pointerId)) {\r\n continue;\r\n }\r\n const lastControlOver = list[pointerId];\r\n if (lastControlOver === control) {\r\n delete list[pointerId];\r\n }\r\n }\r\n }\r\n /**\r\n * @internal\r\n */\r\n public _cleanControlAfterRemoval(control: Control) {\r\n this._cleanControlAfterRemovalFromList(this._lastControlDown, control);\r\n this._cleanControlAfterRemovalFromList(this._lastControlOver, control);\r\n }\r\n\r\n /**\r\n * This function will run a pointer event on this ADT and will trigger any pointer events on any controls\r\n * This will work on a fullscreen ADT only. For mesh based ADT, simulate pointer events using the scene directly.\r\n * @param x pointer X on the canvas for the picking\r\n * @param y pointer Y on the canvas for the picking\r\n * @param pi optional pointer information\r\n */\r\n public pick(x: number, y: number, pi: Nullable<PointerInfoPre> = null) {\r\n if (this._isFullscreen && this._scene) {\r\n this._translateToPicking(this._scene, new Viewport(0, 0, 0, 0), pi, x, y);\r\n }\r\n }\r\n\r\n private _translateToPicking(scene: Scene, tempViewport: Viewport, pi: Nullable<PointerInfoPre>, x: number = scene.pointerX, y: number = scene.pointerY) {\r\n const camera = scene.cameraToUseForPointers || scene.activeCamera;\r\n const engine = scene.getEngine();\r\n const originalCameraToUseForPointers = scene.cameraToUseForPointers;\r\n\r\n if (!camera) {\r\n tempViewport.x = 0;\r\n tempViewport.y = 0;\r\n tempViewport.width = engine.getRenderWidth();\r\n tempViewport.height = engine.getRenderHeight();\r\n } else {\r\n if (camera.rigCameras.length) {\r\n // rig camera - we need to find the camera to use for this event\r\n const rigViewport = new Viewport(0, 0, 1, 1);\r\n camera.rigCameras.forEach((rigCamera) => {\r\n // generate the viewport of this camera\r\n rigCamera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), rigViewport);\r\n const transformedX = x / engine.getHardwareScalingLevel() - rigViewport.x;\r\n const transformedY = y / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - rigViewport.y - rigViewport.height);\r\n // check if the pointer is in the camera's viewport\r\n if (transformedX < 0 || transformedY < 0 || x > rigViewport.width || y > rigViewport.height) {\r\n // out of viewport - don't use this camera\r\n return;\r\n }\r\n // set the camera to use for pointers until this pointer loop is over\r\n scene.cameraToUseForPointers = rigCamera;\r\n // set the viewport\r\n tempViewport.x = rigViewport.x;\r\n tempViewport.y = rigViewport.y;\r\n tempViewport.width = rigViewport.width;\r\n tempViewport.height = rigViewport.height;\r\n });\r\n } else {\r\n camera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), tempViewport);\r\n }\r\n }\r\n\r\n const transformedX = x / engine.getHardwareScalingLevel() - tempViewport.x;\r\n const transformedY = y / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - tempViewport.y - tempViewport.height);\r\n this._shouldBlockPointer = false;\r\n // Do picking modifies _shouldBlockPointer\r\n if (pi) {\r\n const pointerId = (pi.event as IPointerEvent).pointerId || this._defaultMousePointerId;\r\n this._doPicking(transformedX, transformedY, pi, pi.type, pointerId, pi.event.button, (<IWheelEvent>pi.event).deltaX, (<IWheelEvent>pi.event).deltaY);\r\n // Avoid overwriting a true skipOnPointerObservable to false\r\n if ((this._shouldBlockPointer && !(pi.type & this.skipBlockEvents)) || this._capturingControl[pointerId]) {\r\n pi.skipOnPointerObservable = true;\r\n }\r\n } else {\r\n this._doPicking(transformedX, transformedY, null, PointerEventTypes.POINTERMOVE, this._defaultMousePointerId, 0);\r\n }\r\n // if overridden by a rig camera - reset back to the original value\r\n scene.cameraToUseForPointers = originalCameraToUseForPointers;\r\n }\r\n\r\n /** Attach to all scene events required to support pointer events */\r\n public attach(): void {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n\r\n const tempViewport = new Viewport(0, 0, 0, 0);\r\n\r\n this._prePointerObserver = scene.onPrePointerObservable.add((pi) => {\r\n if (\r\n scene.isPointerCaptured((<IPointerEvent>pi.event).pointerId) &&\r\n pi.type === PointerEventTypes.POINTERUP &&\r\n !this._capturedPointerIds.has((pi.event as IPointerEvent).pointerId)\r\n ) {\r\n return;\r\n }\r\n if (\r\n pi.type !== PointerEventTypes.POINTERMOVE &&\r\n pi.type !== PointerEventTypes.POINTERUP &&\r\n pi.type !== PointerEventTypes.POINTERDOWN &&\r\n pi.type !== PointerEventTypes.POINTERWHEEL &&\r\n pi.type !== PointerEventTypes.POINTERTAP\r\n ) {\r\n return;\r\n }\r\n\r\n if (pi.type === PointerEventTypes.POINTERMOVE) {\r\n // Avoid pointerMove events firing while the pointer is captured by the scene\r\n if (scene.isPointerCaptured((<IPointerEvent>pi.event).pointerId)) {\r\n return;\r\n }\r\n if ((pi.event as IPointerEvent).pointerId) {\r\n this._defaultMousePointerId = (pi.event as IPointerEvent).pointerId; // This is required to make sure we have the correct pointer ID for wheel\r\n }\r\n }\r\n this._translateToPicking(scene, tempViewport, pi);\r\n });\r\n this._attachPickingToSceneRender(scene, () => this._translateToPicking(scene, tempViewport, null), false);\r\n this._attachToOnPointerOut(scene);\r\n this._attachToOnBlur(scene);\r\n }\r\n\r\n private _focusProperties: { index: number; total: number } = { index: 0, total: -1 };\r\n\r\n private _focusNextElement(forward: boolean = true): void {\r\n // generate the order of tab-able controls\r\n const sortedTabbableControls: Control[] = [];\r\n this.executeOnAllControls((control) => {\r\n if (control.isFocusInvisible || !control.isVisible || control.tabIndex < 0) {\r\n return;\r\n }\r\n sortedTabbableControls.push(control);\r\n });\r\n // if no control is tab-able, return\r\n if (sortedTabbableControls.length === 0) {\r\n return;\r\n }\r\n sortedTabbableControls.sort((a, b) => {\r\n // if tabIndex is 0, put it in the end of the list, otherwise sort by tabIndex\r\n return a.tabIndex === 0 ? 1 : b.tabIndex === 0 ? -1 : a.tabIndex - b.tabIndex;\r\n });\r\n this._focusProperties.total = sortedTabbableControls.length;\r\n // if no control is focused, focus the first one\r\n let nextIndex = -1;\r\n if (!this._focusedControl) {\r\n nextIndex = forward ? 0 : sortedTabbableControls.length - 1;\r\n } else {\r\n const currentIndex = sortedTabbableControls.indexOf(this._focusedControl);\r\n nextIndex = currentIndex + (forward ? 1 : -1);\r\n if (nextIndex < 0) {\r\n nextIndex = sortedTabbableControls.length - 1;\r\n } else if (nextIndex >= sortedTabbableControls.length) {\r\n nextIndex = 0;\r\n }\r\n }\r\n sortedTabbableControls[nextIndex].focus();\r\n this._focusProperties.index = nextIndex;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n private _onClipboardCopy = (rawEvt: Event) => {\r\n const evt = rawEvt as ClipboardEvent;\r\n const ev = new ClipboardInfo(ClipboardEventTypes.COPY, evt);\r\n this.onClipboardObservable.notifyObservers(ev);\r\n evt.preventDefault();\r\n };\r\n /**\r\n * @internal\r\n */\r\n private _onClipboardCut = (rawEvt: Event) => {\r\n const evt = rawEvt as ClipboardEvent;\r\n const ev = new ClipboardInfo(ClipboardEventTypes.CUT, evt);\r\n this.onClipboardObservable.notifyObservers(ev);\r\n evt.preventDefault();\r\n };\r\n /**\r\n * @internal\r\n */\r\n private _onClipboardPaste = (rawEvt: Event) => {\r\n const evt = rawEvt as ClipboardEvent;\r\n const ev = new ClipboardInfo(ClipboardEventTypes.PASTE, evt);\r\n this.onClipboardObservable.notifyObservers(ev);\r\n evt.preventDefault();\r\n };\r\n /**\r\n * Register the clipboard Events onto the canvas\r\n */\r\n public registerClipboardEvents(): void {\r\n self.addEventListener(\"copy\", this._onClipboardCopy, false);\r\n self.addEventListener(\"cut\", this._onClipboardCut, false);\r\n self.addEventListener(\"paste\", this._onClipboardPaste, false);\r\n }\r\n /**\r\n * Unregister the clipboard Events from the canvas\r\n */\r\n public unRegisterClipboardEvents(): void {\r\n self.removeEventListener(\"copy\", this._onClipboardCopy);\r\n self.removeEventListener(\"cut\", this._onClipboardCut);\r\n self.removeEventListener(\"paste\", this._onClipboardPaste);\r\n }\r\n\r\n /**\r\n * Transform uvs from mesh space to texture space, taking the texture into account\r\n * @param uv the uvs in mesh space\r\n * @returns the uvs in texture space\r\n */\r\n private _transformUvs(uv: Vector2): Vector2 {\r\n const textureMatrix = this.getTextureMatrix();\r\n let result;\r\n if (textureMatrix.isIdentityAs3x2()) {\r\n result = uv;\r\n } else {\r\n const homogeneousTextureMatrix = TmpVectors.Matrix[0];\r\n\r\n textureMatrix.getRowToRef(0, TmpVectors.Vector4[0]);\r\n textureMatrix.getRowToRef(1, TmpVectors.Vector4[1]);\r\n textureMatrix.getRowToRef(2, TmpVectors.Vector4[2]);\r\n\r\n const r0 = TmpVectors.Vector4[0];\r\n const r1 = TmpVectors.Vector4[1];\r\n const r2 = TmpVectors.Vector4[2];\r\n\r\n homogeneousTextureMatrix.setRowFromFloats(0, r0.x, r0.y, 0, 0);\r\n homogeneousTextureMatrix.setRowFromFloats(1, r1.x, r1.y, 0, 0);\r\n homogeneousTextureMatrix.setRowFromFloats(2, 0, 0, 1, 0);\r\n homogeneousTextureMatrix.setRowFromFloats(3, r2.x, r2.y, 0, 1);\r\n\r\n result = TmpVectors.Vector2[0];\r\n Vector2.TransformToRef(uv, homogeneousTextureMatrix, result);\r\n }\r\n\r\n // In wrap and mirror mode, the texture coordinate for coordinates more than 1 is the fractional part of the coordinate\r\n if (this.wrapU === Texture.WRAP_ADDRESSMODE || this.wrapU === Texture.MIRROR_ADDRESSMODE) {\r\n if (result.x > 1) {\r\n let fX = result.x - Math.trunc(result.x);\r\n // In mirror mode, the sign of the texture coordinate depends on the integer part -\r\n // odd integers means it is mirrored from the original coordinate\r\n if (this.wrapU === Texture.MIRROR_ADDRESSMODE && Math.trunc(result.x) % 2 === 1) {\r\n fX = 1 - fX;\r\n }\r\n result.x = fX;\r\n }\r\n }\r\n if (this.wrapV === Texture.WRAP_ADDRESSMODE || this.wrapV === Texture.MIRROR_ADDRESSMODE) {\r\n if (result.y > 1) {\r\n let fY = result.y - Math.trunc(result.y);\r\n if (this.wrapV === Texture.MIRROR_ADDRESSMODE && Math.trunc(result.x) % 2 === 1) {\r\n fY = 1 - fY;\r\n }\r\n result.y = fY;\r\n }\r\n }\r\n return result;\r\n }\r\n /**\r\n * Connect the texture to a hosting mesh to enable interactions\r\n * @param mesh defines the mesh to attach to\r\n * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well\r\n */\r\n public attachToMesh(mesh: AbstractMesh, supportPointerMove = true): void {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n\r\n if (this._pointerObserver) {\r\n scene.onPointerObservable.remove(this._pointerObserver);\r\n }\r\n\r\n this._pointerObserver = scene.onPointerObservable.add((pi) => {\r\n if (\r\n pi.type !== PointerEventTypes.POINTERMOVE &&\r\n pi.type !== PointerEventTypes.POINTERUP &&\r\n pi.type !== PointerEventTypes.POINTERDOWN &&\r\n pi.type !== PointerEventTypes.POINTERWHEEL\r\n ) {\r\n return;\r\n }\r\n\r\n if (pi.type === PointerEventTypes.POINTERMOVE && (pi.event as IPointerEvent).pointerId) {\r\n this._defaultMousePointerId = (pi.event as IPointerEvent).pointerId; // This is required to make sure we have the correct pointer ID for wheel\r\n }\r\n\r\n const pointerId = (pi.event as IPointerEvent).pointerId || this._defaultMousePointerId;\r\n if (pi.pickInfo && pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh) {\r\n let uv = pi.pickInfo.getTextureCoordinates();\r\n if (uv) {\r\n uv = this._transformUvs(uv);\r\n const size = this.getSize();\r\n this._doPicking(\r\n uv.x * size.width,\r\n (this.applyYInversionOnUpdate ? 1.0 - uv.y : uv.y) * size.height,\r\n pi,\r\n pi.type,\r\n pointerId,\r\n pi.event.button,\r\n (<IWheelEvent>pi.event).deltaX,\r\n (<IWheelEvent>pi.event).deltaY\r\n );\r\n }\r\n } else if (pi.type === PointerEventTypes.POINTERUP) {\r\n if (this._lastControlDown[pointerId]) {\r\n this._lastControlDown[pointerId]._forcePointerUp(pointerId);\r\n }\r\n delete this._lastControlDown[pointerId];\r\n if (this.focusedControl) {\r\n const friendlyControls = this.focusedControl.keepsFocusWith();\r\n let canMoveFocus = true;\r\n if (friendlyControls) {\r\n for (const control of friendlyControls) {\r\n // Same host, no need to keep the focus\r\n if (this === control._host) {\r\n continue;\r\n }\r\n // Different hosts\r\n const otherHost = control._host;\r\n if (otherHost._lastControlOver[pointerId] && otherHost._lastControlOver[pointerId].isAscendant(control)) {\r\n canMoveFocus = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (canMoveFocus) {\r\n this.focusedControl = null;\r\n }\r\n }\r\n } else if (pi.type === PointerEventTypes.POINTERMOVE) {\r\n if (this._lastControlOver[pointerId]) {\r\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi, true);\r\n }\r\n delete this._lastControlOver[pointerId];\r\n }\r\n });\r\n mesh.enablePointerMoveEvents = supportPointerMove;\r\n this._attachPickingToSceneRender(\r\n scene,\r\n () => {\r\n const pointerId = this._defaultMousePointerId;\r\n const pick = scene?.pick(scene.pointerX, scene.pointerY);\r\n if (pick && pick.hit && pick.pickedMesh === mesh) {\r\n let uv = pick.getTextureCoordinates();\r\n if (uv) {\r\n uv = this._transformUvs(uv);\r\n const size = this.getSize();\r\n this._doPicking(uv.x * size.width, (this.applyYInversionOnUpdate ? 1.0 - uv.y : uv.y) * size.height, null, PointerEventTypes.POINTERMOVE, pointerId, 0);\r\n }\r\n } else {\r\n if (this._lastControlOver[pointerId]) {\r\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], null, true);\r\n }\r\n delete this._lastControlOver[pointerId];\r\n }\r\n },\r\n true\r\n );\r\n this._attachToOnPointerOut(scene);\r\n this._attachToOnBlur(scene);\r\n }\r\n /**\r\n * Move the focus to a specific control\r\n * @param control defines the control which will receive the focus\r\n */\r\n public moveFocusToControl(control: Control): void {\r\n this.focusedControl = control;\r\n this._lastPickedControl = <any>control;\r\n this._blockNextFocusCheck = true;\r\n }\r\n private _manageFocus(): void {\r\n if (this._blockNextFocusCheck) {\r\n this._blockNextFocusCheck = false;\r\n this._lastPickedControl = <any>this._focusedControl;\r\n return;\r\n }\r\n // Focus management\r\n if (this._focusedControl) {\r\n if (this._focusedControl !== <any>this._lastPickedControl) {\r\n if (this._lastPickedControl.isFocusInvisible) {\r\n return;\r\n }\r\n this.focusedControl = null;\r\n }\r\n }\r\n }\r\n private _attachPickingToSceneRender(scene: Scene, pickFunction: () => void, forcePicking: boolean) {\r\n this._sceneRenderObserver = scene.onBeforeRenderObservable.add(() => {\r\n if (!this.checkPointerEveryFrame) {\r\n return;\r\n }\r\n if (this._linkedControls.length > 0 || forcePicking) {\r\n pickFunction();\r\n }\r\n });\r\n }\r\n private _attachToOnPointerOut(scene: Scene): void {\r\n this._canvasPointerOutObserver = scene.getEngine().onCanvasPointerOutObservable.add((pointerEvent) => {\r\n if (this._lastControlOver[pointerEvent.pointerId]) {\r\n this._lastControlOver[pointerEvent.pointerId]._onPointerOut(this._lastControlOver[pointerEvent.pointerId], null);\r\n }\r\n delete this._lastControlOver[pointerEvent.pointerId];\r\n if (this._lastControlDown[pointerEvent.pointerId] && this._lastControlDown[pointerEvent.pointerId] !== this._capturingControl[pointerEvent.pointerId]) {\r\n this._lastControlDown[pointerEvent.pointerId]._forcePointerUp(pointerEvent.pointerId);\r\n delete this._lastControlDown[pointerEvent.pointerId];\r\n }\r\n });\r\n }\r\n private _attachToOnBlur(scene: Scene): void {\r\n this._canvasBlurObserver = scene.getEngine().onCanvasBlurObservable.add(() => {\r\n Object.entries(this._lastControlDown).forEach(([, value]) => {\r\n value._onCanvasBlur();\r\n });\r\n this.focusedControl = null;\r\n this._lastControlDown = {};\r\n });\r\n }\r\n\r\n /**\r\n * Serializes the entire GUI system\r\n * @returns an object with the JSON serialized data\r\n */\r\n public serializeContent(): any {\r\n const size = this.getSize();\r\n const serializationObject = {\r\n root: {},\r\n width: size.width,\r\n height: size.height,\r\n };\r\n\r\n this._rootContainer.serialize(serializationObject.root);\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Recreate the content of the ADT from a JSON object\r\n * @param serializedObject define the JSON serialized object to restore from\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n */\r\n public parseSerializedObject(serializedObject: any, scaleToSize?: boolean, urlRewriter?: (url: string) => string) {\r\n this._rootContainer = Control.Parse(serializedObject.root, this, urlRewriter) as Container;\r\n if (scaleToSize) {\r\n const width = serializedObject.width;\r\n const height = serializedObject.height;\r\n if (typeof width === \"number\" && typeof height === \"number\" && width >= 0 && height >= 0) {\r\n this.scaleTo(width, height);\r\n } else {\r\n // scales the GUI to a default size if none was available in the serialized content\r\n this.scaleTo(1920, 1080);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clones the ADT. If no mesh is defined, the GUI will be considered as a fullscreen GUI\r\n * @param newName defines the name of the new ADT\r\n * @param attachToMesh defines if the new ADT should be attached to a mesh\r\n * @returns the clone of the ADT\r\n */\r\n public override clone(newName?: string, attachToMesh?: AbstractMesh): AdvancedDynamicTexture {\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return this;\r\n }\r\n const size = this.getSize();\r\n const data = this.serializeContent();\r\n let clone;\r\n if (!this._isFullscreen) {\r\n if (attachToMesh) {\r\n clone = AdvancedDynamicTexture.CreateForMesh(attachToMesh, size.width, size.height);\r\n } else {\r\n clone = new AdvancedDynamicTexture(newName ?? \"Clone of \" + this.name, size.width, size.height, scene, !this.noMipmap, this.samplingMode);\r\n }\r\n } else {\r\n clone = AdvancedDynamicTexture.CreateFullscreenUI(newName ?? \"Clone of \" + this.name);\r\n }\r\n clone.parseSerializedObject(data);\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Recreate the content of the ADT from a JSON object\r\n * @param serializedObject define the JSON serialized object to restore from\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @deprecated Please use parseSerializedObject instead\r\n */\r\n public parseContent = this.parseSerializedObject;\r\n\r\n /**\r\n * Recreate the content of the ADT from a snippet saved by the GUI editor\r\n * @param snippetId defines the snippet to load\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns a promise that will resolve on success\r\n */\r\n public static async ParseFromSnippetAsync(\r\n snippetId: string,\r\n scaleToSize?: boolean,\r\n appendToAdt?: AdvancedDynamicTexture,\r\n urlRewriter?: (url: string) => string\r\n ): Promise<AdvancedDynamicTexture> {\r\n const adt = appendToAdt ?? AdvancedDynamicTexture.CreateFullscreenUI(\"ADT from snippet\");\r\n if (snippetId === \"_BLANK\") {\r\n return adt;\r\n }\r\n\r\n const serialized = await AdvancedDynamicTexture._LoadURLContentAsync(AdvancedDynamicTexture.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"), true);\r\n adt.parseSerializedObject(serialized, scaleToSize, urlRewriter);\r\n return adt;\r\n }\r\n\r\n /**\r\n * Recreate the content of the ADT from a snippet saved by the GUI editor\r\n * @param snippetId defines the snippet to load\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns a promise that will resolve on success\r\n */\r\n public parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture> {\r\n return AdvancedDynamicTexture.ParseFromSnippetAsync(snippetId, scaleToSize, this, urlRewriter);\r\n }\r\n\r\n /**\r\n * Recreate the content of the ADT from a url json\r\n * @param url defines the url to load\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns a promise that will resolve on success\r\n */\r\n public static async ParseFromFileAsync(\r\n url: string,\r\n scaleToSize?: boolean,\r\n appendToAdt?: AdvancedDynamicTexture,\r\n urlRewriter?: (url: string) => string\r\n ): Promise<AdvancedDynamicTexture> {\r\n const adt = appendToAdt ?? AdvancedDynamicTexture.CreateFullscreenUI(\"ADT from URL\");\r\n const serialized = await AdvancedDynamicTexture._LoadURLContentAsync(url);\r\n adt.parseSerializedObject(serialized, scaleToSize, urlRewriter);\r\n return adt;\r\n }\r\n\r\n /**\r\n * Recreate the content of the ADT from a url json\r\n * @param url defines the url to load\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns a promise that will resolve on success\r\n */\r\n public parseFromURLAsync(url: string, scaleToSize?: boolean, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture> {\r\n return AdvancedDynamicTexture.ParseFromFileAsync(url, scaleToSize, this, urlRewriter);\r\n }\r\n\r\n private static _LoadURLContentAsync(url: string, snippet: boolean = false): Promise<any> {\r\n if (url === \"\") {\r\n return Promise.reject(\"No URL provided\");\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n let gui;\r\n if (snippet) {\r\n const payload = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n gui = payload.encodedGui ? new TextDecoder(\"utf-8\").decode(DecodeBase64ToBinary(payload.encodedGui)) : payload.gui;\r\n } else {\r\n gui = request.responseText;\r\n }\r\n const serializationObject = JSON.parse(gui);\r\n resolve(serializationObject);\r\n } else {\r\n reject(\"Unable to load\");\r\n }\r\n }\r\n });\r\n request.open(\"GET\", url);\r\n request.send();\r\n });\r\n }\r\n\r\n // Statics\r\n /**\r\n * Compares two rectangle based controls for pixel overlap\r\n * @param control1 The first control to compare\r\n * @param control2 The second control to compare\r\n * @returns true if overlaps, otherwise false\r\n */\r\n private static _Overlaps(control1: Control, control2: Control) {\r\n return !(\r\n control1.centerX > control2.centerX + control2.widthInPixels ||\r\n control1.centerX + control1.widthInPixels < control2.centerX ||\r\n control1.centerY + control1.heightInPixels < control2.centerY ||\r\n control1.centerY > control2.centerY + control2.heightInPixels\r\n );\r\n }\r\n\r\n /**\r\n * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)\r\n * @param mesh defines the mesh which will receive the texture\r\n * @param width defines the texture width (1024 by default)\r\n * @param height defines the texture height (1024 by default)\r\n * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)\r\n * @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)\r\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\r\n * @param materialSetupCallback defines a custom way of creating and setting up the material on the mesh\r\n * @param sampling defines the texture sampling mode (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @returns a new AdvancedDynamicTexture\r\n */\r\n public static CreateForMesh(\r\n mesh: AbstractMesh,\r\n width = 1024,\r\n height = 1024,\r\n supportPointerMove = true,\r\n onlyAlphaTesting = false,\r\n invertY?: boolean,\r\n materialSetupCallback: (mesh: AbstractMesh, uniqueId: string, texture: AdvancedDynamicTexture, onlyAlphaTesting: boolean) => void = this._CreateMaterial,\r\n sampling = Texture.TRILINEAR_SAMPLINGMODE\r\n ): AdvancedDynamicTexture {\r\n // use a unique ID in name so serialization will work even if you create two ADTs for a single mesh\r\n const uniqueId = RandomGUID();\r\n const result = new AdvancedDynamicTexture(`AdvancedDynamicTexture for ${mesh.name} [${uniqueId}]`, width, height, mesh.getScene(), true, sampling, invertY);\r\n\r\n materialSetupCallback(mesh, uniqueId, result, onlyAlphaTesting);\r\n\r\n result.attachToMesh(mesh, supportPointerMove);\r\n return result;\r\n }\r\n\r\n private static _CreateMaterial(mesh: AbstractMesh, uniqueId: string, texture: AdvancedDynamicTexture, onlyAlphaTesting: boolean): void {\r\n const internalClassType = GetClass(\"BABYLON.StandardMaterial\");\r\n if (!internalClassType) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"StandardMaterial needs to be imported before as it contains a side-effect required by your code.\";\r\n }\r\n\r\n const material: StandardMaterial = new internalClassType(`AdvancedDynamicTextureMaterial for ${mesh.name} [${uniqueId}]`, mesh.getScene());\r\n material.backFaceCulling = false;\r\n material.diffuseColor = Color3.Black();\r\n material.specularColor = Color3.Black();\r\n if (onlyAlphaTesting) {\r\n material.diffuseTexture = texture;\r\n material.emissiveTexture = texture;\r\n texture.hasAlpha = true;\r\n } else {\r\n material.emissiveTexture = texture;\r\n material.opacityTexture = texture;\r\n }\r\n mesh.material = material;\r\n }\r\n\r\n /**\r\n * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) BUT do not create a new material for the mesh. You will be responsible for connecting the texture\r\n * @param mesh defines the mesh which will receive the texture\r\n * @param width defines the texture width (1024 by default)\r\n * @param height defines the texture height (1024 by default)\r\n * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)\r\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\r\n * @param sampling defines the texture sampling mode (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @returns a new AdvancedDynamicTexture\r\n */\r\n public static CreateForMeshTexture(\r\n mesh: AbstractMesh,\r\n width = 1024,\r\n height = 1024,\r\n supportPointerMove = true,\r\n invertY?: boolean,\r\n sampling = Texture.TRILINEAR_SAMPLINGMODE\r\n ): AdvancedDynamicTexture {\r\n const result = new AdvancedDynamicTexture(mesh.name + \" AdvancedDynamicTexture\", width, height, mesh.getScene(), true, sampling, invertY);\r\n result.attachToMesh(mesh, supportPointerMove);\r\n return result;\r\n }\r\n /**\r\n * Creates a new AdvancedDynamicTexture in fullscreen mode.\r\n * In this mode the texture will rely on a layer for its rendering.\r\n * This allows it to be treated like any other layer.\r\n * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.\r\n * LayerMask is set through advancedTexture.layer.layerMask\r\n * @param name defines name for the texture\r\n * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)\r\n * @param scene defines the hosting scene\r\n * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)\r\n * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)\r\n * @returns a new AdvancedDynamicTexture\r\n */\r\n public static CreateFullscreenUI(\r\n name: string,\r\n foreground: boolean = true,\r\n scene: Nullable<Scene> = null,\r\n sampling = Texture.BILINEAR_SAMPLINGMODE,\r\n adaptiveScaling: boolean = false\r\n ): AdvancedDynamicTexture {\r\n const result = new AdvancedDynamicTexture(name, 0, 0, scene, false, sampling);\r\n // Display\r\n const resultScene = result.getScene();\r\n const layer = new Layer(name + \"_layer\", null, resultScene, !foreground);\r\n layer.texture = result;\r\n result._layerToDispose = layer;\r\n result._isFullscreen = true;\r\n\r\n if (adaptiveScaling && resultScene) {\r\n const newScale = 1 / resultScene.getEngine().getHardwareScalingLevel();\r\n result._rootContainer.scaleX = newScale;\r\n result._rootContainer.scaleY = newScale;\r\n }\r\n\r\n // Attach\r\n result.attach();\r\n return result;\r\n }\r\n\r\n /**\r\n * Scales the texture\r\n * @param ratio the scale factor to apply to both width and height\r\n */\r\n public override scale(ratio: number): void {\r\n super.scale(ratio);\r\n this.markAsDirty();\r\n }\r\n\r\n /**\r\n * Resizes the texture\r\n * @param width the new width\r\n * @param height the new height\r\n */\r\n public override scaleTo(width: number, height: number): void {\r\n super.scaleTo(width, height);\r\n this.markAsDirty();\r\n }\r\n\r\n private _checkGuiIsReady() {\r\n if (this.guiIsReady()) {\r\n this.onGuiReadyObservable.notifyObservers(this);\r\n\r\n this.onGuiReadyObservable.clear();\r\n }\r\n }\r\n\r\n /**\r\n * @returns true if all the GUI components are ready to render\r\n */\r\n public guiIsReady(): boolean {\r\n return this._rootContainer.isReady();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"advancedDynamicTexture.js","sourceRoot":"","sources":["../../../../dev/gui/src/2D/advancedDynamicTexture.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAElD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,6CAA+B;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B,GAAG,IAAI,AAAP,CAAQ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport { Vector2, Vector3, TmpVectors } from \"core/Maths/math.vector\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport type { PointerInfoPre, PointerInfo, PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\nimport { ClipboardEventTypes, ClipboardInfo } from \"core/Events/clipboardEvents\";\r\nimport type { KeyboardInfoPre } from \"core/Events/keyboardEvents\";\r\nimport { KeyboardEventTypes } from \"core/Events/keyboardEvents\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { IDynamicTextureOptions } from \"core/Materials/Textures/dynamicTexture\";\r\nimport { DynamicTexture } from \"core/Materials/Textures/dynamicTexture\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { Layer } from \"core/Layers/layer\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport { Container } from \"./controls/container\";\r\nimport { Control } from \"./controls/control\";\r\nimport { Style } from \"./style\";\r\nimport { Measure } from \"./measure\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { Viewport } from \"core/Maths/math.viewport\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { WebRequest } from \"core/Misc/webRequest\";\r\nimport type { IPointerEvent, IWheelEvent } from \"core/Events/deviceInputEvents\";\r\nimport { RandomGUID } from \"core/Misc/guid\";\r\nimport { GetClass } from \"core/Misc/typeStore\";\r\nimport { DecodeBase64ToBinary } from \"core/Misc/stringTools\";\r\n\r\nimport type { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport type { AbstractEngine } from \"core/Engines/abstractEngine\";\r\n\r\n/**\r\n * Interface used to define options to create an AdvancedDynamicTexture\r\n */\r\nexport interface IAdvancedDynamicTextureOptions extends IDynamicTextureOptions {\r\n /**\r\n * Indicates whether the ADT will be used autonomously. In this mode:\r\n * - _checkUpdate() is not called\r\n * - the layer is not rendered (so, the ADT is not visible)\r\n * It's up to the user to perform the required calls manually to update the ADT.\r\n */\r\n useStandalone?: boolean;\r\n}\r\n\r\n/**\r\n * Class used to create texture to support 2D GUI elements\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui\r\n */\r\nexport class AdvancedDynamicTexture extends DynamicTexture {\r\n /** Define the url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */\r\n public static AllowGPUOptimizations = true;\r\n\r\n /** Indicates whether the ADT is used autonomously */\r\n public readonly useStandalone: boolean = false;\r\n\r\n /** Snippet ID if the content was created from the snippet server */\r\n public snippetId: string;\r\n\r\n /** Observable that fires when the GUI is ready */\r\n public onGuiReadyObservable = new Observable<AdvancedDynamicTexture>();\r\n\r\n private _isDirty = false;\r\n private _renderObserver: Nullable<Observer<Camera>>;\r\n private _resizeObserver: Nullable<Observer<AbstractEngine>>;\r\n private _preKeyboardObserver: Nullable<Observer<KeyboardInfoPre>>;\r\n private _prePointerObserver: Nullable<Observer<PointerInfoPre>>;\r\n private _sceneRenderObserver: Nullable<Observer<Scene>>;\r\n private _pointerObserver: Nullable<Observer<PointerInfo>>;\r\n private _canvasPointerOutObserver: Nullable<Observer<PointerEvent>>;\r\n private _canvasBlurObserver: Nullable<Observer<AbstractEngine>>;\r\n private _controlAddedObserver: Nullable<Observer<Nullable<Control>>>;\r\n private _controlRemovedObserver: Nullable<Observer<Nullable<Control>>>;\r\n private _background: string;\r\n /** @internal */\r\n public _rootContainer = new Container(\"root\");\r\n /** @internal */\r\n public _lastPickedControl: Control;\r\n /** @internal */\r\n public _lastControlOver: { [pointerId: number]: Control } = {};\r\n /** @internal */\r\n public _lastControlDown: { [pointerId: number]: Control } = {};\r\n /** @internal */\r\n public _capturingControl: { [pointerId: number]: Control } = {};\r\n /** @internal */\r\n public _shouldBlockPointer: boolean;\r\n /** @internal */\r\n public _layerToDispose: Nullable<Layer>;\r\n /** @internal */\r\n public _linkedControls = new Array<Control>();\r\n /** @internal */\r\n public _isFullscreen = false;\r\n private _fullscreenViewport = new Viewport(0, 0, 1, 1);\r\n private _idealWidth = 0;\r\n private _idealHeight = 0;\r\n private _useSmallestIdeal: boolean = false;\r\n private _renderAtIdealSize = false;\r\n private _focusedControl: Nullable<Control>;\r\n private _blockNextFocusCheck = false;\r\n private _renderScale = 1;\r\n private _rootElement: Nullable<HTMLElement>;\r\n private _cursorChanged = false;\r\n private _defaultMousePointerId = 0;\r\n private _rootChildrenHaveChanged: boolean = false;\r\n\r\n /** @internal */\r\n public _capturedPointerIds = new Set<number>();\r\n\r\n /** @internal */\r\n public _numLayoutCalls = 0;\r\n /** Gets the number of layout calls made the last time the ADT has been rendered */\r\n public get numLayoutCalls(): number {\r\n return this._numLayoutCalls;\r\n }\r\n\r\n /** @internal */\r\n public _numRenderCalls = 0;\r\n /** Gets the number of render calls made the last time the ADT has been rendered */\r\n public get numRenderCalls(): number {\r\n return this._numRenderCalls;\r\n }\r\n\r\n /**\r\n * Define type to string to ensure compatibility across browsers\r\n * Safari doesn't support DataTransfer constructor\r\n */\r\n private _clipboardData: string = \"\";\r\n /**\r\n * Observable event triggered each time an clipboard event is received from the rendering canvas\r\n */\r\n public onClipboardObservable = new Observable<ClipboardInfo>();\r\n /**\r\n * Observable event triggered each time a pointer down is intercepted by a control\r\n */\r\n public onControlPickedObservable = new Observable<Control>();\r\n /**\r\n * Observable event triggered before layout is evaluated\r\n */\r\n public onBeginLayoutObservable = new Observable<AdvancedDynamicTexture>();\r\n /**\r\n * Observable event triggered after the layout was evaluated\r\n */\r\n public onEndLayoutObservable = new Observable<AdvancedDynamicTexture>();\r\n /**\r\n * Observable event triggered before the texture is rendered\r\n */\r\n public onBeginRenderObservable = new Observable<AdvancedDynamicTexture>();\r\n /**\r\n * Observable event triggered after the texture was rendered\r\n */\r\n public onEndRenderObservable = new Observable<AdvancedDynamicTexture>();\r\n /**\r\n * Gets or sets a boolean defining if alpha is stored as premultiplied\r\n */\r\n public premulAlpha = false;\r\n /**\r\n * Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture\r\n */\r\n public applyYInversionOnUpdate = true;\r\n\r\n /**\r\n * A boolean indicating whether or not the elements can be navigated to using the tab key.\r\n * Defaults to false.\r\n */\r\n public disableTabNavigation = false;\r\n\r\n /**\r\n * A boolean indicating whether controls can be picked/clicked on or not. Defaults to false.\r\n */\r\n public disablePicking = false;\r\n\r\n /**\r\n * If set to true, the POINTERTAP event type will be used for \"click\", instead of POINTERUP\r\n */\r\n public usePointerTapForClickEvent = false;\r\n /**\r\n * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).\r\n * Useful when you want more antialiasing\r\n */\r\n public get renderScale(): number {\r\n return this._renderScale;\r\n }\r\n public set renderScale(value: number) {\r\n if (value === this._renderScale) {\r\n return;\r\n }\r\n this._renderScale = value;\r\n this._onResize();\r\n }\r\n /** Gets or sets the background color */\r\n public get background(): string {\r\n return this._background;\r\n }\r\n public set background(value: string) {\r\n if (this._background === value) {\r\n return;\r\n }\r\n this._background = value;\r\n this.markAsDirty();\r\n }\r\n /**\r\n * Gets or sets the ideal width used to design controls.\r\n * The GUI will then rescale everything accordingly\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling\r\n */\r\n public get idealWidth(): number {\r\n return this._idealWidth;\r\n }\r\n public set idealWidth(value: number) {\r\n if (this._idealWidth === value) {\r\n return;\r\n }\r\n this._idealWidth = value;\r\n this.markAsDirty();\r\n this._rootContainer._markAllAsDirty();\r\n }\r\n /**\r\n * Gets or sets the ideal height used to design controls.\r\n * The GUI will then rescale everything accordingly\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling\r\n */\r\n public get idealHeight(): number {\r\n return this._idealHeight;\r\n }\r\n public set idealHeight(value: number) {\r\n if (this._idealHeight === value) {\r\n return;\r\n }\r\n this._idealHeight = value;\r\n this.markAsDirty();\r\n this._rootContainer._markAllAsDirty();\r\n }\r\n /**\r\n * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling\r\n */\r\n public get useSmallestIdeal(): boolean {\r\n return this._useSmallestIdeal;\r\n }\r\n public set useSmallestIdeal(value: boolean) {\r\n if (this._useSmallestIdeal === value) {\r\n return;\r\n }\r\n this._useSmallestIdeal = value;\r\n this.markAsDirty();\r\n this._rootContainer._markAllAsDirty();\r\n }\r\n /**\r\n * Gets or sets a boolean indicating if adaptive scaling must be used\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling\r\n */\r\n public get renderAtIdealSize(): boolean {\r\n return this._renderAtIdealSize;\r\n }\r\n public set renderAtIdealSize(value: boolean) {\r\n if (this._renderAtIdealSize === value) {\r\n return;\r\n }\r\n this._renderAtIdealSize = value;\r\n this._onResize();\r\n }\r\n\r\n /**\r\n * Gets the ratio used when in \"ideal mode\"\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#adaptive-scaling\r\n * */\r\n public get idealRatio(): number {\r\n let rwidth: number = 0;\r\n let rheight: number = 0;\r\n\r\n if (this._idealWidth) {\r\n rwidth = this.getSize().width / this._idealWidth;\r\n }\r\n\r\n if (this._idealHeight) {\r\n rheight = this.getSize().height / this._idealHeight;\r\n }\r\n\r\n if (this._useSmallestIdeal && this._idealWidth && this._idealHeight) {\r\n return window.innerWidth < window.innerHeight ? rwidth : rheight;\r\n }\r\n\r\n if (this._idealWidth) {\r\n // horizontal\r\n return rwidth;\r\n }\r\n\r\n if (this._idealHeight) {\r\n // vertical\r\n return rheight;\r\n }\r\n\r\n return 1;\r\n }\r\n\r\n /**\r\n * Gets the underlying layer used to render the texture when in fullscreen mode\r\n */\r\n public get layer(): Nullable<Layer> {\r\n return this._layerToDispose;\r\n }\r\n /**\r\n * Gets the root container control\r\n */\r\n public get rootContainer(): Container {\r\n return this._rootContainer;\r\n }\r\n /**\r\n * Returns an array containing the root container.\r\n * This is mostly used to let the Inspector introspects the ADT\r\n * @returns an array containing the rootContainer\r\n */\r\n public getChildren(): Array<Container> {\r\n return [this._rootContainer];\r\n }\r\n /**\r\n * Will return all controls that are inside this texture\r\n * @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\r\n * @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\r\n * @returns all child controls\r\n */\r\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[] {\r\n return this._rootContainer.getDescendants(directDescendantsOnly, predicate);\r\n }\r\n\r\n /**\r\n * Will return all controls with the given type name\r\n * @param typeName defines the type name to search for\r\n * @returns an array of all controls found\r\n */\r\n public getControlsByType(typeName: string): Control[] {\r\n return this._rootContainer.getDescendants(false, (control) => control.typeName === typeName);\r\n }\r\n\r\n /**\r\n * Will return the first control with the given name\r\n * @param name defines the name to search for\r\n * @returns the first control found or null\r\n */\r\n public getControlByName(name: string): Nullable<Control> {\r\n return this._getControlByKey(\"name\", name);\r\n }\r\n\r\n private _getControlByKey(key: string, value: any): Nullable<Control> {\r\n return this._rootContainer.getDescendants().find((control) => control[key as keyof Control] === value) || null;\r\n }\r\n\r\n /**\r\n * Gets or sets the current focused control\r\n */\r\n public get focusedControl(): Nullable<Control> {\r\n return this._focusedControl;\r\n }\r\n public set focusedControl(control: Nullable<Control>) {\r\n if (this._focusedControl == control) {\r\n return;\r\n }\r\n if (this._focusedControl) {\r\n this._focusedControl.onBlur();\r\n }\r\n if (control) {\r\n control.onFocus();\r\n }\r\n this._focusedControl = control;\r\n }\r\n /**\r\n * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode\r\n */\r\n public get isForeground(): boolean {\r\n if (!this.layer) {\r\n return true;\r\n }\r\n return !this.layer.isBackground;\r\n }\r\n public set isForeground(value: boolean) {\r\n if (!this.layer) {\r\n return;\r\n }\r\n if (this.layer.isBackground === !value) {\r\n return;\r\n }\r\n this.layer.isBackground = !value;\r\n }\r\n /**\r\n * Gets or set information about clipboardData\r\n */\r\n public get clipboardData(): string {\r\n return this._clipboardData;\r\n }\r\n public set clipboardData(value: string) {\r\n this._clipboardData = value;\r\n }\r\n\r\n /**\r\n * If this is set, even when a control is pointer blocker, some events can still be passed through to the scene.\r\n * Options from values are PointerEventTypes\r\n * POINTERDOWN, POINTERUP, POINTERMOVE, POINTERWHEEL, POINTERPICK, POINTERTAP, POINTERDOUBLETAP\r\n */\r\n public skipBlockEvents = 0;\r\n\r\n /**\r\n * If set to true, every scene render will trigger a pointer event for the GUI\r\n * if it is linked to a mesh or has controls linked to a mesh. This will allow\r\n * you to catch the pointer moving around the GUI due to camera or mesh movements,\r\n * but it has a performance cost.\r\n */\r\n public checkPointerEveryFrame = false;\r\n\r\n /**\r\n * Creates a new AdvancedDynamicTexture\r\n * @param name defines the name of the texture\r\n * @param options The options to be used when constructing the ADT\r\n */\r\n constructor(name: string, options?: IAdvancedDynamicTextureOptions);\r\n\r\n constructor(name: string, width?: number, height?: number, scene?: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number, invertY?: boolean);\r\n\r\n /** @internal */\r\n constructor(\r\n name: string,\r\n widthOrOptions?: number | IAdvancedDynamicTextureOptions,\r\n _height = 0,\r\n scene?: Nullable<Scene>,\r\n generateMipMaps = false,\r\n samplingMode = Texture.NEAREST_SAMPLINGMODE,\r\n invertY = true\r\n ) {\r\n widthOrOptions = widthOrOptions ?? 0;\r\n\r\n const width = typeof widthOrOptions === \"object\" && widthOrOptions !== undefined ? (widthOrOptions.width ?? 0) : (widthOrOptions ?? 0);\r\n const height = typeof widthOrOptions === \"object\" && widthOrOptions !== undefined ? (widthOrOptions.height ?? 0) : _height;\r\n\r\n super(\r\n name,\r\n { width, height },\r\n typeof widthOrOptions === \"object\" && widthOrOptions !== undefined ? widthOrOptions : scene,\r\n generateMipMaps,\r\n samplingMode,\r\n Constants.TEXTUREFORMAT_RGBA,\r\n invertY\r\n );\r\n\r\n scene = this.getScene();\r\n if (!scene || !this._texture) {\r\n return;\r\n }\r\n this.applyYInversionOnUpdate = invertY;\r\n this._rootElement = scene.getEngine().getInputElement();\r\n\r\n const adtOptions = widthOrOptions as IAdvancedDynamicTextureOptions;\r\n\r\n this.useStandalone = !!adtOptions?.useStandalone;\r\n\r\n if (!this.useStandalone) {\r\n this._renderObserver = scene.onBeforeCameraRenderObservable.add((camera: Camera) => this._checkUpdate(camera));\r\n }\r\n\r\n /** Whenever a control is added or removed to the root, we have to recheck the camera projection as it can have changed */\r\n this._controlAddedObserver = this._rootContainer.onControlAddedObservable.add((control) => {\r\n if (control) {\r\n this._rootChildrenHaveChanged = true;\r\n }\r\n });\r\n this._controlRemovedObserver = this._rootContainer.onControlRemovedObservable.add((control) => {\r\n if (control) {\r\n this._rootChildrenHaveChanged = true;\r\n }\r\n });\r\n this._preKeyboardObserver = scene.onPreKeyboardObservable.add((info) => {\r\n // check if tab is pressed\r\n if (!this.disableTabNavigation && info.type === KeyboardEventTypes.KEYDOWN && info.event.code === \"Tab\") {\r\n const forward = !info.event.shiftKey;\r\n if (\r\n (forward && this._focusProperties.index === this._focusProperties.total - 1) ||\r\n (!forward && this._focusProperties.index === 0 && this._focusProperties.total > 0)\r\n ) {\r\n this.focusedControl = null;\r\n this._focusProperties.index = 0;\r\n this._focusProperties.total = -1;\r\n return;\r\n }\r\n this._focusNextElement(forward);\r\n info.event.preventDefault();\r\n return;\r\n }\r\n if (!this._focusedControl) {\r\n return;\r\n }\r\n if (info.type === KeyboardEventTypes.KEYDOWN) {\r\n this._focusedControl.processKeyboard(info.event);\r\n }\r\n info.skipOnPointerObservable = true;\r\n });\r\n this._rootContainer._link(this);\r\n this.hasAlpha = true;\r\n if (!width || !height) {\r\n this._resizeObserver = scene.getEngine().onResizeObservable.add(() => this._onResize());\r\n this._onResize();\r\n }\r\n this._texture.isReady = true;\r\n }\r\n /**\r\n * Get the current class name of the texture useful for serialization or dynamic coding.\r\n * @returns \"AdvancedDynamicTexture\"\r\n */\r\n public override getClassName(): string {\r\n return \"AdvancedDynamicTexture\";\r\n }\r\n /**\r\n * Function used to execute a function on all controls\r\n * @param func defines the function to execute\r\n * @param container defines the container where controls belong. If null the root container will be used\r\n */\r\n public executeOnAllControls(func: (control: Control) => void, container?: Container) {\r\n if (!container) {\r\n container = this._rootContainer;\r\n }\r\n func(container);\r\n for (const child of container.children) {\r\n if ((<any>child).children) {\r\n this.executeOnAllControls(func, <Container>child);\r\n continue;\r\n }\r\n func(child);\r\n }\r\n }\r\n\r\n private _useInvalidateRectOptimization = true;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the InvalidateRect optimization should be turned on\r\n */\r\n public get useInvalidateRectOptimization(): boolean {\r\n return this._useInvalidateRectOptimization;\r\n }\r\n\r\n public set useInvalidateRectOptimization(value: boolean) {\r\n this._useInvalidateRectOptimization = value;\r\n }\r\n\r\n // Invalidated rectangle which is the combination of all invalidated controls after they have been rotated into absolute position\r\n private _invalidatedRectangle: Nullable<Measure> = null;\r\n /**\r\n * Invalidates a rectangle area on the gui texture\r\n * @param invalidMinX left most position of the rectangle to invalidate in the texture\r\n * @param invalidMinY top most position of the rectangle to invalidate in the texture\r\n * @param invalidMaxX right most position of the rectangle to invalidate in the texture\r\n * @param invalidMaxY bottom most position of the rectangle to invalidate in the texture\r\n */\r\n public invalidateRect(invalidMinX: number, invalidMinY: number, invalidMaxX: number, invalidMaxY: number) {\r\n if (!this._useInvalidateRectOptimization) {\r\n return;\r\n }\r\n if (!this._invalidatedRectangle) {\r\n this._invalidatedRectangle = new Measure(invalidMinX, invalidMinY, invalidMaxX - invalidMinX + 1, invalidMaxY - invalidMinY + 1);\r\n } else {\r\n // Compute intersection\r\n const maxX = Math.ceil(Math.max(this._invalidatedRectangle.left + this._invalidatedRectangle.width - 1, invalidMaxX));\r\n const maxY = Math.ceil(Math.max(this._invalidatedRectangle.top + this._invalidatedRectangle.height - 1, invalidMaxY));\r\n this._invalidatedRectangle.left = Math.floor(Math.min(this._invalidatedRectangle.left, invalidMinX));\r\n this._invalidatedRectangle.top = Math.floor(Math.min(this._invalidatedRectangle.top, invalidMinY));\r\n this._invalidatedRectangle.width = maxX - this._invalidatedRectangle.left + 1;\r\n this._invalidatedRectangle.height = maxY - this._invalidatedRectangle.top + 1;\r\n }\r\n }\r\n /**\r\n * Marks the texture as dirty forcing a complete update\r\n */\r\n public markAsDirty() {\r\n this._isDirty = true;\r\n }\r\n /**\r\n * Helper function used to create a new style\r\n * @returns a new style\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#styles\r\n */\r\n public createStyle(): Style {\r\n return new Style(this);\r\n }\r\n /**\r\n * Adds a new control to the root container\r\n * @param control defines the control to add\r\n * @returns the current texture\r\n */\r\n public addControl(control: Control): AdvancedDynamicTexture {\r\n this._rootContainer.addControl(control);\r\n return this;\r\n }\r\n /**\r\n * Removes a control from the root container\r\n * @param control defines the control to remove\r\n * @returns the current texture\r\n */\r\n public removeControl(control: Control): AdvancedDynamicTexture {\r\n this._rootContainer.removeControl(control);\r\n return this;\r\n }\r\n /**\r\n * Moves overlapped controls towards a position where it is not overlapping anymore.\r\n * Please note that this method alters linkOffsetXInPixels and linkOffsetYInPixels.\r\n * @param overlapGroup the overlap group which will be processed or undefined to process all overlap groups\r\n * @param deltaStep the step size (speed) to reach the target non overlapping position (default 0.1)\r\n * @param repelFactor how much is the control repelled by other controls\r\n */\r\n public moveToNonOverlappedPosition(overlapGroup?: number | Control[], deltaStep = 1, repelFactor = 1) {\r\n let controlsForGroup: Control[];\r\n if (Array.isArray(overlapGroup)) {\r\n controlsForGroup = overlapGroup;\r\n } else {\r\n const descendants = this.getDescendants(true);\r\n // get only the controls with an overlapGroup property set\r\n // if the overlapGroup parameter is set, filter the controls and get only the controls belonging to that overlapGroup\r\n controlsForGroup = overlapGroup === undefined ? descendants.filter((c) => c.overlapGroup !== undefined) : descendants.filter((c) => c.overlapGroup === overlapGroup);\r\n }\r\n\r\n controlsForGroup.forEach((control1) => {\r\n let velocity = Vector2.Zero();\r\n const center = new Vector2(control1.centerX, control1.centerY);\r\n\r\n controlsForGroup.forEach((control2) => {\r\n if (control1 !== control2 && AdvancedDynamicTexture._Overlaps(control1, control2)) {\r\n // if the two controls overlaps get a direction vector from one control's center to another control's center\r\n const diff = center.subtract(new Vector2(control2.centerX, control2.centerY));\r\n const diffLength = diff.length();\r\n\r\n if (diffLength > 0) {\r\n // calculate the velocity\r\n velocity = velocity.add(diff.normalize().scale(repelFactor / diffLength));\r\n }\r\n }\r\n });\r\n\r\n if (velocity.length() > 0) {\r\n // move the control along the direction vector away from the overlapping control\r\n velocity = velocity.normalize().scale(deltaStep * (control1.overlapDeltaMultiplier ?? 1));\r\n control1.linkOffsetXInPixels += velocity.x;\r\n control1.linkOffsetYInPixels += velocity.y;\r\n }\r\n });\r\n }\r\n /**\r\n * Release all resources\r\n */\r\n public override dispose(): void {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n this._rootElement = null;\r\n scene.onBeforeCameraRenderObservable.remove(this._renderObserver);\r\n if (this._resizeObserver) {\r\n scene.getEngine().onResizeObservable.remove(this._resizeObserver);\r\n }\r\n if (this._prePointerObserver) {\r\n scene.onPrePointerObservable.remove(this._prePointerObserver);\r\n }\r\n if (this._sceneRenderObserver) {\r\n scene.onBeforeRenderObservable.remove(this._sceneRenderObserver);\r\n }\r\n if (this._pointerObserver) {\r\n scene.onPointerObservable.remove(this._pointerObserver);\r\n }\r\n if (this._preKeyboardObserver) {\r\n scene.onPreKeyboardObservable.remove(this._preKeyboardObserver);\r\n }\r\n if (this._canvasPointerOutObserver) {\r\n scene.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver);\r\n }\r\n if (this._canvasBlurObserver) {\r\n scene.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver);\r\n }\r\n if (this._controlAddedObserver) {\r\n this._rootContainer.onControlAddedObservable.remove(this._controlAddedObserver);\r\n }\r\n if (this._controlRemovedObserver) {\r\n this._rootContainer.onControlRemovedObservable.remove(this._controlRemovedObserver);\r\n }\r\n if (this._layerToDispose) {\r\n this._layerToDispose.texture = null;\r\n this._layerToDispose.dispose();\r\n this._layerToDispose = null;\r\n }\r\n this._rootContainer.dispose();\r\n this.onClipboardObservable.clear();\r\n this.onControlPickedObservable.clear();\r\n this.onBeginRenderObservable.clear();\r\n this.onEndRenderObservable.clear();\r\n this.onBeginLayoutObservable.clear();\r\n this.onEndLayoutObservable.clear();\r\n this.onGuiReadyObservable.clear();\r\n super.dispose();\r\n }\r\n private _onResize(): void {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n // Check size\r\n const engine = scene.getEngine();\r\n const textureSize = this.getSize();\r\n let renderWidth = engine.getRenderWidth() * this._renderScale;\r\n let renderHeight = engine.getRenderHeight() * this._renderScale;\r\n\r\n if (this._renderAtIdealSize) {\r\n if (this._idealWidth) {\r\n renderHeight = (renderHeight * this._idealWidth) / renderWidth;\r\n renderWidth = this._idealWidth;\r\n } else if (this._idealHeight) {\r\n renderWidth = (renderWidth * this._idealHeight) / renderHeight;\r\n renderHeight = this._idealHeight;\r\n }\r\n }\r\n if (textureSize.width !== renderWidth || textureSize.height !== renderHeight) {\r\n this.scaleTo(renderWidth, renderHeight);\r\n this.markAsDirty();\r\n if (this._idealWidth || this._idealHeight) {\r\n this._rootContainer._markAllAsDirty();\r\n }\r\n }\r\n this.invalidateRect(0, 0, textureSize.width - 1, textureSize.height - 1);\r\n }\r\n /** @internal */\r\n public _getGlobalViewport(): Viewport {\r\n const size = this.getSize();\r\n const globalViewPort = this._fullscreenViewport.toGlobal(size.width, size.height);\r\n\r\n const targetX = Math.round(globalViewPort.width * (1 / this.rootContainer.scaleX));\r\n const targetY = Math.round(globalViewPort.height * (1 / this.rootContainer.scaleY));\r\n\r\n globalViewPort.x += (globalViewPort.width - targetX) / 2;\r\n globalViewPort.y += (globalViewPort.height - targetY) / 2;\r\n\r\n globalViewPort.width = targetX;\r\n globalViewPort.height = targetY;\r\n\r\n return globalViewPort;\r\n }\r\n /**\r\n * Get screen coordinates for a vector3\r\n * @param position defines the position to project\r\n * @param worldMatrix defines the world matrix to use\r\n * @returns the projected position\r\n */\r\n public getProjectedPosition(position: Vector3, worldMatrix: Matrix): Vector2 {\r\n const result = this.getProjectedPositionWithZ(position, worldMatrix);\r\n return new Vector2(result.x, result.y);\r\n }\r\n\r\n /**\r\n * Get screen coordinates for a vector3\r\n * @param position defines the position to project\r\n * @param worldMatrix defines the world matrix to use\r\n * @returns the projected position with Z\r\n */\r\n public getProjectedPositionWithZ(position: Vector3, worldMatrix: Matrix): Vector3 {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return Vector3.Zero();\r\n }\r\n const globalViewport = this._getGlobalViewport();\r\n const projectedPosition = Vector3.Project(position, worldMatrix, scene.getTransformMatrix(), globalViewport);\r\n return new Vector3(projectedPosition.x, projectedPosition.y, projectedPosition.z);\r\n }\r\n\r\n /** @internal */\r\n public _checkUpdate(camera: Nullable<Camera>, skipUpdate?: boolean): void {\r\n if (this._layerToDispose && camera) {\r\n if ((camera.layerMask & this._layerToDispose.layerMask) === 0) {\r\n return;\r\n }\r\n }\r\n if (this._isFullscreen && this._linkedControls.length) {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n const globalViewport = this._getGlobalViewport();\r\n for (const control of this._linkedControls) {\r\n if (!control.isVisible) {\r\n continue;\r\n }\r\n const mesh = control._linkedMesh as AbstractMesh;\r\n if (!mesh || mesh.isDisposed()) {\r\n Tools.SetImmediate(() => {\r\n control.linkWithMesh(null);\r\n });\r\n continue;\r\n }\r\n const position = mesh.getBoundingInfo ? mesh.getBoundingInfo().boundingSphere.center : (Vector3.ZeroReadOnly as Vector3);\r\n const projectedPosition = Vector3.Project(position, mesh.getWorldMatrix(), scene.getTransformMatrix(), globalViewport);\r\n if (projectedPosition.z < 0 || projectedPosition.z > 1) {\r\n control.notRenderable = true;\r\n continue;\r\n }\r\n control.notRenderable = false;\r\n if (this.useInvalidateRectOptimization) {\r\n control.invalidateRect();\r\n }\r\n\r\n control._moveToProjectedPosition(projectedPosition);\r\n }\r\n }\r\n if (!this._isDirty && !this._rootContainer.isDirty) {\r\n return;\r\n }\r\n this._isDirty = false;\r\n this._render(skipUpdate);\r\n if (!skipUpdate) {\r\n this.update(this.applyYInversionOnUpdate, this.premulAlpha, AdvancedDynamicTexture.AllowGPUOptimizations);\r\n }\r\n }\r\n\r\n private _clearMeasure = new Measure(0, 0, 0, 0);\r\n\r\n private _render(skipRender?: boolean): void {\r\n const textureSize = this.getSize();\r\n const renderWidth = textureSize.width;\r\n const renderHeight = textureSize.height;\r\n\r\n const context = this.getContext();\r\n context.font = \"18px Arial\";\r\n context.strokeStyle = \"white\";\r\n\r\n if (this.onGuiReadyObservable.hasObservers()) {\r\n this._checkGuiIsReady();\r\n }\r\n\r\n /** We have to recheck the camera projection in the case the root control's children have changed */\r\n if (this._rootChildrenHaveChanged) {\r\n const camera = this.getScene()?.activeCamera;\r\n if (camera) {\r\n this._rootChildrenHaveChanged = false;\r\n this._checkUpdate(camera, true);\r\n }\r\n }\r\n\r\n // Layout\r\n this.onBeginLayoutObservable.notifyObservers(this);\r\n const measure = new Measure(0, 0, renderWidth, renderHeight);\r\n this._numLayoutCalls = 0;\r\n this._rootContainer._layout(measure, context);\r\n this.onEndLayoutObservable.notifyObservers(this);\r\n this._isDirty = false; // Restoring the dirty state that could have been set by controls during layout processing\r\n\r\n if (skipRender) {\r\n return;\r\n }\r\n\r\n // Clear\r\n if (this._invalidatedRectangle) {\r\n this._clearMeasure.copyFrom(this._invalidatedRectangle);\r\n } else {\r\n this._clearMeasure.copyFromFloats(0, 0, renderWidth, renderHeight);\r\n }\r\n context.clearRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);\r\n if (this._background) {\r\n context.save();\r\n context.fillStyle = this._background;\r\n context.fillRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);\r\n context.restore();\r\n }\r\n\r\n // Render\r\n this.onBeginRenderObservable.notifyObservers(this);\r\n this._numRenderCalls = 0;\r\n this._rootContainer._render(context, this._invalidatedRectangle);\r\n this.onEndRenderObservable.notifyObservers(this);\r\n this._invalidatedRectangle = null;\r\n }\r\n /**\r\n * @internal\r\n */\r\n public _changeCursor(cursor: string) {\r\n if (this._rootElement) {\r\n this._rootElement.style.cursor = cursor;\r\n this._cursorChanged = true;\r\n }\r\n }\r\n /**\r\n * @internal\r\n */\r\n public _registerLastControlDown(control: Control, pointerId: number) {\r\n this._lastControlDown[pointerId] = control;\r\n this.onControlPickedObservable.notifyObservers(control);\r\n }\r\n private _doPicking(x: number, y: number, pi: Nullable<PointerInfoBase>, type: number, pointerId: number, buttonIndex: number, deltaX?: number, deltaY?: number): void {\r\n const scene = this.getScene();\r\n if (!scene || this.disablePicking) {\r\n return;\r\n }\r\n const engine = scene.getEngine();\r\n const textureSize = this.getSize();\r\n if (this._isFullscreen) {\r\n const camera = scene.cameraToUseForPointers || scene.activeCamera;\r\n if (!camera) {\r\n return;\r\n }\r\n const viewport = camera.viewport;\r\n x = x * (textureSize.width / (engine.getRenderWidth() * viewport.width));\r\n y = y * (textureSize.height / (engine.getRenderHeight() * viewport.height));\r\n }\r\n if (this._capturingControl[pointerId]) {\r\n if (this._capturingControl[pointerId].isPointerBlocker) {\r\n this._shouldBlockPointer = true;\r\n }\r\n this._capturingControl[pointerId]._processObservables(type, x, y, pi, pointerId, buttonIndex);\r\n return;\r\n }\r\n\r\n this._cursorChanged = false;\r\n if (!this._rootContainer._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) {\r\n if (!scene.doNotHandleCursors) {\r\n this._changeCursor(\"\");\r\n }\r\n if (type === PointerEventTypes.POINTERMOVE) {\r\n if (this._lastControlOver[pointerId]) {\r\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi);\r\n delete this._lastControlOver[pointerId];\r\n }\r\n }\r\n }\r\n\r\n if (!this._cursorChanged && !scene.doNotHandleCursors) {\r\n this._changeCursor(\"\");\r\n }\r\n this._manageFocus();\r\n }\r\n /**\r\n * @internal\r\n */\r\n public _cleanControlAfterRemovalFromList(list: { [pointerId: number]: Control }, control: Control) {\r\n for (const pointerId in list) {\r\n if (!Object.prototype.hasOwnProperty.call(list, pointerId)) {\r\n continue;\r\n }\r\n const lastControlOver = list[pointerId];\r\n if (lastControlOver === control) {\r\n delete list[pointerId];\r\n }\r\n }\r\n }\r\n /**\r\n * @internal\r\n */\r\n public _cleanControlAfterRemoval(control: Control) {\r\n this._cleanControlAfterRemovalFromList(this._lastControlDown, control);\r\n this._cleanControlAfterRemovalFromList(this._lastControlOver, control);\r\n }\r\n\r\n /**\r\n * This function will run a pointer event on this ADT and will trigger any pointer events on any controls\r\n * This will work on a fullscreen ADT only. For mesh based ADT, simulate pointer events using the scene directly.\r\n * @param x pointer X on the canvas for the picking\r\n * @param y pointer Y on the canvas for the picking\r\n * @param pi optional pointer information\r\n */\r\n public pick(x: number, y: number, pi: Nullable<PointerInfoPre> = null) {\r\n if (this._isFullscreen && this._scene) {\r\n this._translateToPicking(this._scene, new Viewport(0, 0, 0, 0), pi, x, y);\r\n }\r\n }\r\n\r\n private _translateToPicking(scene: Scene, tempViewport: Viewport, pi: Nullable<PointerInfoPre>, x: number = scene.pointerX, y: number = scene.pointerY) {\r\n const camera = scene.cameraToUseForPointers || scene.activeCamera;\r\n const engine = scene.getEngine();\r\n const originalCameraToUseForPointers = scene.cameraToUseForPointers;\r\n\r\n if (!camera) {\r\n tempViewport.x = 0;\r\n tempViewport.y = 0;\r\n tempViewport.width = engine.getRenderWidth();\r\n tempViewport.height = engine.getRenderHeight();\r\n } else {\r\n if (camera.rigCameras.length) {\r\n // rig camera - we need to find the camera to use for this event\r\n const rigViewport = new Viewport(0, 0, 1, 1);\r\n camera.rigCameras.forEach((rigCamera) => {\r\n // generate the viewport of this camera\r\n rigCamera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), rigViewport);\r\n const transformedX = x / engine.getHardwareScalingLevel() - rigViewport.x;\r\n const transformedY = y / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - rigViewport.y - rigViewport.height);\r\n // check if the pointer is in the camera's viewport\r\n if (transformedX < 0 || transformedY < 0 || x > rigViewport.width || y > rigViewport.height) {\r\n // out of viewport - don't use this camera\r\n return;\r\n }\r\n // set the camera to use for pointers until this pointer loop is over\r\n scene.cameraToUseForPointers = rigCamera;\r\n // set the viewport\r\n tempViewport.x = rigViewport.x;\r\n tempViewport.y = rigViewport.y;\r\n tempViewport.width = rigViewport.width;\r\n tempViewport.height = rigViewport.height;\r\n });\r\n } else {\r\n camera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), tempViewport);\r\n }\r\n }\r\n\r\n const transformedX = x / engine.getHardwareScalingLevel() - tempViewport.x;\r\n const transformedY = y / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - tempViewport.y - tempViewport.height);\r\n this._shouldBlockPointer = false;\r\n // Do picking modifies _shouldBlockPointer\r\n if (pi) {\r\n const pointerId = (pi.event as IPointerEvent).pointerId || this._defaultMousePointerId;\r\n this._doPicking(transformedX, transformedY, pi, pi.type, pointerId, pi.event.button, (<IWheelEvent>pi.event).deltaX, (<IWheelEvent>pi.event).deltaY);\r\n // Avoid overwriting a true skipOnPointerObservable to false\r\n if ((this._shouldBlockPointer && !(pi.type & this.skipBlockEvents)) || this._capturingControl[pointerId]) {\r\n pi.skipOnPointerObservable = true;\r\n }\r\n } else {\r\n this._doPicking(transformedX, transformedY, null, PointerEventTypes.POINTERMOVE, this._defaultMousePointerId, 0);\r\n }\r\n // if overridden by a rig camera - reset back to the original value\r\n scene.cameraToUseForPointers = originalCameraToUseForPointers;\r\n }\r\n\r\n /** Attach to all scene events required to support pointer events */\r\n public attach(): void {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n\r\n const tempViewport = new Viewport(0, 0, 0, 0);\r\n\r\n this._prePointerObserver = scene.onPrePointerObservable.add((pi) => {\r\n if (\r\n scene.isPointerCaptured((<IPointerEvent>pi.event).pointerId) &&\r\n pi.type === PointerEventTypes.POINTERUP &&\r\n !this._capturedPointerIds.has((pi.event as IPointerEvent).pointerId)\r\n ) {\r\n return;\r\n }\r\n if (\r\n pi.type !== PointerEventTypes.POINTERMOVE &&\r\n pi.type !== PointerEventTypes.POINTERUP &&\r\n pi.type !== PointerEventTypes.POINTERDOWN &&\r\n pi.type !== PointerEventTypes.POINTERWHEEL &&\r\n pi.type !== PointerEventTypes.POINTERTAP\r\n ) {\r\n return;\r\n }\r\n\r\n if (pi.type === PointerEventTypes.POINTERMOVE) {\r\n // Avoid pointerMove events firing while the pointer is captured by the scene\r\n if (scene.isPointerCaptured((<IPointerEvent>pi.event).pointerId)) {\r\n return;\r\n }\r\n if ((pi.event as IPointerEvent).pointerId) {\r\n this._defaultMousePointerId = (pi.event as IPointerEvent).pointerId; // This is required to make sure we have the correct pointer ID for wheel\r\n }\r\n }\r\n this._translateToPicking(scene, tempViewport, pi);\r\n });\r\n this._attachPickingToSceneRender(scene, () => this._translateToPicking(scene, tempViewport, null), false);\r\n this._attachToOnPointerOut(scene);\r\n this._attachToOnBlur(scene);\r\n }\r\n\r\n private _focusProperties: { index: number; total: number } = { index: 0, total: -1 };\r\n\r\n private _focusNextElement(forward: boolean = true): void {\r\n // generate the order of tab-able controls\r\n const sortedTabbableControls: Control[] = [];\r\n this.executeOnAllControls((control) => {\r\n if (control.isFocusInvisible || !control.isVisible || control.tabIndex < 0) {\r\n return;\r\n }\r\n sortedTabbableControls.push(control);\r\n });\r\n // if no control is tab-able, return\r\n if (sortedTabbableControls.length === 0) {\r\n return;\r\n }\r\n sortedTabbableControls.sort((a, b) => {\r\n // if tabIndex is 0, put it in the end of the list, otherwise sort by tabIndex\r\n return a.tabIndex === 0 ? 1 : b.tabIndex === 0 ? -1 : a.tabIndex - b.tabIndex;\r\n });\r\n this._focusProperties.total = sortedTabbableControls.length;\r\n // if no control is focused, focus the first one\r\n let nextIndex = -1;\r\n if (!this._focusedControl) {\r\n nextIndex = forward ? 0 : sortedTabbableControls.length - 1;\r\n } else {\r\n const currentIndex = sortedTabbableControls.indexOf(this._focusedControl);\r\n nextIndex = currentIndex + (forward ? 1 : -1);\r\n if (nextIndex < 0) {\r\n nextIndex = sortedTabbableControls.length - 1;\r\n } else if (nextIndex >= sortedTabbableControls.length) {\r\n nextIndex = 0;\r\n }\r\n }\r\n sortedTabbableControls[nextIndex].focus();\r\n this._focusProperties.index = nextIndex;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n private _onClipboardCopy = (rawEvt: Event) => {\r\n const evt = rawEvt as ClipboardEvent;\r\n const ev = new ClipboardInfo(ClipboardEventTypes.COPY, evt);\r\n this.onClipboardObservable.notifyObservers(ev);\r\n evt.preventDefault();\r\n };\r\n /**\r\n * @internal\r\n */\r\n private _onClipboardCut = (rawEvt: Event) => {\r\n const evt = rawEvt as ClipboardEvent;\r\n const ev = new ClipboardInfo(ClipboardEventTypes.CUT, evt);\r\n this.onClipboardObservable.notifyObservers(ev);\r\n evt.preventDefault();\r\n };\r\n /**\r\n * @internal\r\n */\r\n private _onClipboardPaste = (rawEvt: Event) => {\r\n const evt = rawEvt as ClipboardEvent;\r\n const ev = new ClipboardInfo(ClipboardEventTypes.PASTE, evt);\r\n this.onClipboardObservable.notifyObservers(ev);\r\n evt.preventDefault();\r\n };\r\n /**\r\n * Register the clipboard Events onto the canvas\r\n */\r\n public registerClipboardEvents(): void {\r\n self.addEventListener(\"copy\", this._onClipboardCopy, false);\r\n self.addEventListener(\"cut\", this._onClipboardCut, false);\r\n self.addEventListener(\"paste\", this._onClipboardPaste, false);\r\n }\r\n /**\r\n * Unregister the clipboard Events from the canvas\r\n */\r\n public unRegisterClipboardEvents(): void {\r\n self.removeEventListener(\"copy\", this._onClipboardCopy);\r\n self.removeEventListener(\"cut\", this._onClipboardCut);\r\n self.removeEventListener(\"paste\", this._onClipboardPaste);\r\n }\r\n\r\n /**\r\n * Transform uvs from mesh space to texture space, taking the texture into account\r\n * @param uv the uvs in mesh space\r\n * @returns the uvs in texture space\r\n */\r\n private _transformUvs(uv: Vector2): Vector2 {\r\n const textureMatrix = this.getTextureMatrix();\r\n let result;\r\n if (textureMatrix.isIdentityAs3x2()) {\r\n result = uv;\r\n } else {\r\n const homogeneousTextureMatrix = TmpVectors.Matrix[0];\r\n\r\n textureMatrix.getRowToRef(0, TmpVectors.Vector4[0]);\r\n textureMatrix.getRowToRef(1, TmpVectors.Vector4[1]);\r\n textureMatrix.getRowToRef(2, TmpVectors.Vector4[2]);\r\n\r\n const r0 = TmpVectors.Vector4[0];\r\n const r1 = TmpVectors.Vector4[1];\r\n const r2 = TmpVectors.Vector4[2];\r\n\r\n homogeneousTextureMatrix.setRowFromFloats(0, r0.x, r0.y, 0, 0);\r\n homogeneousTextureMatrix.setRowFromFloats(1, r1.x, r1.y, 0, 0);\r\n homogeneousTextureMatrix.setRowFromFloats(2, 0, 0, 1, 0);\r\n homogeneousTextureMatrix.setRowFromFloats(3, r2.x, r2.y, 0, 1);\r\n\r\n result = TmpVectors.Vector2[0];\r\n Vector2.TransformToRef(uv, homogeneousTextureMatrix, result);\r\n }\r\n\r\n // In wrap and mirror mode, the texture coordinate for coordinates more than 1 is the fractional part of the coordinate\r\n if (this.wrapU === Texture.WRAP_ADDRESSMODE || this.wrapU === Texture.MIRROR_ADDRESSMODE) {\r\n if (result.x > 1) {\r\n let fX = result.x - Math.trunc(result.x);\r\n // In mirror mode, the sign of the texture coordinate depends on the integer part -\r\n // odd integers means it is mirrored from the original coordinate\r\n if (this.wrapU === Texture.MIRROR_ADDRESSMODE && Math.trunc(result.x) % 2 === 1) {\r\n fX = 1 - fX;\r\n }\r\n result.x = fX;\r\n }\r\n }\r\n if (this.wrapV === Texture.WRAP_ADDRESSMODE || this.wrapV === Texture.MIRROR_ADDRESSMODE) {\r\n if (result.y > 1) {\r\n let fY = result.y - Math.trunc(result.y);\r\n if (this.wrapV === Texture.MIRROR_ADDRESSMODE && Math.trunc(result.x) % 2 === 1) {\r\n fY = 1 - fY;\r\n }\r\n result.y = fY;\r\n }\r\n }\r\n return result;\r\n }\r\n /**\r\n * Connect the texture to a hosting mesh to enable interactions\r\n * @param mesh defines the mesh to attach to\r\n * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well\r\n */\r\n public attachToMesh(mesh: AbstractMesh, supportPointerMove = true): void {\r\n const scene = this.getScene();\r\n if (!scene) {\r\n return;\r\n }\r\n\r\n if (this._pointerObserver) {\r\n scene.onPointerObservable.remove(this._pointerObserver);\r\n }\r\n\r\n this._pointerObserver = scene.onPointerObservable.add((pi) => {\r\n if (\r\n pi.type !== PointerEventTypes.POINTERMOVE &&\r\n pi.type !== PointerEventTypes.POINTERUP &&\r\n pi.type !== PointerEventTypes.POINTERDOWN &&\r\n pi.type !== PointerEventTypes.POINTERWHEEL\r\n ) {\r\n return;\r\n }\r\n\r\n if (pi.type === PointerEventTypes.POINTERMOVE && (pi.event as IPointerEvent).pointerId) {\r\n this._defaultMousePointerId = (pi.event as IPointerEvent).pointerId; // This is required to make sure we have the correct pointer ID for wheel\r\n }\r\n\r\n const pointerId = (pi.event as IPointerEvent).pointerId || this._defaultMousePointerId;\r\n if (pi.pickInfo && pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh) {\r\n let uv = pi.pickInfo.getTextureCoordinates();\r\n if (uv) {\r\n uv = this._transformUvs(uv);\r\n const size = this.getSize();\r\n this._doPicking(\r\n uv.x * size.width,\r\n (this.applyYInversionOnUpdate ? 1.0 - uv.y : uv.y) * size.height,\r\n pi,\r\n pi.type,\r\n pointerId,\r\n pi.event.button,\r\n (<IWheelEvent>pi.event).deltaX,\r\n (<IWheelEvent>pi.event).deltaY\r\n );\r\n }\r\n } else if (pi.type === PointerEventTypes.POINTERUP) {\r\n if (this._lastControlDown[pointerId]) {\r\n this._lastControlDown[pointerId]._forcePointerUp(pointerId);\r\n }\r\n delete this._lastControlDown[pointerId];\r\n if (this.focusedControl) {\r\n const friendlyControls = this.focusedControl.keepsFocusWith();\r\n let canMoveFocus = true;\r\n if (friendlyControls) {\r\n for (const control of friendlyControls) {\r\n // Same host, no need to keep the focus\r\n if (this === control._host) {\r\n continue;\r\n }\r\n // Different hosts\r\n const otherHost = control._host;\r\n if (otherHost._lastControlOver[pointerId] && otherHost._lastControlOver[pointerId].isAscendant(control)) {\r\n canMoveFocus = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (canMoveFocus) {\r\n this.focusedControl = null;\r\n }\r\n }\r\n } else if (pi.type === PointerEventTypes.POINTERMOVE) {\r\n if (this._lastControlOver[pointerId]) {\r\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi, true);\r\n }\r\n delete this._lastControlOver[pointerId];\r\n }\r\n });\r\n mesh.enablePointerMoveEvents = supportPointerMove;\r\n this._attachPickingToSceneRender(\r\n scene,\r\n () => {\r\n const pointerId = this._defaultMousePointerId;\r\n const pick = scene?.pick(scene.pointerX, scene.pointerY);\r\n if (pick && pick.hit && pick.pickedMesh === mesh) {\r\n let uv = pick.getTextureCoordinates();\r\n if (uv) {\r\n uv = this._transformUvs(uv);\r\n const size = this.getSize();\r\n this._doPicking(uv.x * size.width, (this.applyYInversionOnUpdate ? 1.0 - uv.y : uv.y) * size.height, null, PointerEventTypes.POINTERMOVE, pointerId, 0);\r\n }\r\n } else {\r\n if (this._lastControlOver[pointerId]) {\r\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], null, true);\r\n }\r\n delete this._lastControlOver[pointerId];\r\n }\r\n },\r\n true\r\n );\r\n this._attachToOnPointerOut(scene);\r\n this._attachToOnBlur(scene);\r\n }\r\n /**\r\n * Move the focus to a specific control\r\n * @param control defines the control which will receive the focus\r\n */\r\n public moveFocusToControl(control: Control): void {\r\n this.focusedControl = control;\r\n this._lastPickedControl = <any>control;\r\n this._blockNextFocusCheck = true;\r\n }\r\n private _manageFocus(): void {\r\n if (this._blockNextFocusCheck) {\r\n this._blockNextFocusCheck = false;\r\n this._lastPickedControl = <any>this._focusedControl;\r\n return;\r\n }\r\n // Focus management\r\n if (this._focusedControl) {\r\n if (this._focusedControl !== <any>this._lastPickedControl) {\r\n if (this._lastPickedControl.isFocusInvisible) {\r\n return;\r\n }\r\n this.focusedControl = null;\r\n }\r\n }\r\n }\r\n private _attachPickingToSceneRender(scene: Scene, pickFunction: () => void, forcePicking: boolean) {\r\n this._sceneRenderObserver = scene.onBeforeRenderObservable.add(() => {\r\n if (!this.checkPointerEveryFrame) {\r\n return;\r\n }\r\n if (this._linkedControls.length > 0 || forcePicking) {\r\n pickFunction();\r\n }\r\n });\r\n }\r\n private _attachToOnPointerOut(scene: Scene): void {\r\n this._canvasPointerOutObserver = scene.getEngine().onCanvasPointerOutObservable.add((pointerEvent) => {\r\n if (this._lastControlOver[pointerEvent.pointerId]) {\r\n this._lastControlOver[pointerEvent.pointerId]._onPointerOut(this._lastControlOver[pointerEvent.pointerId], null);\r\n }\r\n delete this._lastControlOver[pointerEvent.pointerId];\r\n if (this._lastControlDown[pointerEvent.pointerId] && this._lastControlDown[pointerEvent.pointerId] !== this._capturingControl[pointerEvent.pointerId]) {\r\n this._lastControlDown[pointerEvent.pointerId]._forcePointerUp(pointerEvent.pointerId);\r\n delete this._lastControlDown[pointerEvent.pointerId];\r\n }\r\n });\r\n }\r\n private _attachToOnBlur(scene: Scene): void {\r\n this._canvasBlurObserver = scene.getEngine().onCanvasBlurObservable.add(() => {\r\n Object.entries(this._lastControlDown).forEach(([, value]) => {\r\n value._onCanvasBlur();\r\n });\r\n this.focusedControl = null;\r\n this._lastControlDown = {};\r\n });\r\n }\r\n\r\n /**\r\n * Serializes the entire GUI system\r\n * @returns an object with the JSON serialized data\r\n */\r\n public serializeContent(): any {\r\n const size = this.getSize();\r\n const serializationObject = {\r\n root: {},\r\n width: size.width,\r\n height: size.height,\r\n };\r\n\r\n this._rootContainer.serialize(serializationObject.root);\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Recreate the content of the ADT from a JSON object\r\n * @param serializedObject define the JSON serialized object to restore from\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n */\r\n public parseSerializedObject(serializedObject: any, scaleToSize?: boolean, urlRewriter?: (url: string) => string) {\r\n this._rootContainer = Control.Parse(serializedObject.root, this, urlRewriter) as Container;\r\n if (scaleToSize) {\r\n const width = serializedObject.width;\r\n const height = serializedObject.height;\r\n if (typeof width === \"number\" && typeof height === \"number\" && width >= 0 && height >= 0) {\r\n this.scaleTo(width, height);\r\n } else {\r\n // scales the GUI to a default size if none was available in the serialized content\r\n this.scaleTo(1920, 1080);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clones the ADT. If no mesh is defined, the GUI will be considered as a fullscreen GUI\r\n * @param newName defines the name of the new ADT\r\n * @param attachToMesh defines if the new ADT should be attached to a mesh\r\n * @returns the clone of the ADT\r\n */\r\n public override clone(newName?: string, attachToMesh?: AbstractMesh): AdvancedDynamicTexture {\r\n const scene = this.getScene();\r\n\r\n if (!scene) {\r\n return this;\r\n }\r\n const size = this.getSize();\r\n const data = this.serializeContent();\r\n let clone;\r\n if (!this._isFullscreen) {\r\n if (attachToMesh) {\r\n clone = AdvancedDynamicTexture.CreateForMesh(attachToMesh, size.width, size.height);\r\n } else {\r\n clone = new AdvancedDynamicTexture(newName ?? \"Clone of \" + this.name, size.width, size.height, scene, !this.noMipmap, this.samplingMode);\r\n }\r\n } else {\r\n clone = AdvancedDynamicTexture.CreateFullscreenUI(newName ?? \"Clone of \" + this.name);\r\n }\r\n clone.parseSerializedObject(data);\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Recreate the content of the ADT from a JSON object\r\n * @param serializedObject define the JSON serialized object to restore from\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @deprecated Please use parseSerializedObject instead\r\n */\r\n public parseContent = this.parseSerializedObject;\r\n\r\n /**\r\n * Recreate the content of the ADT from a snippet saved by the GUI editor\r\n * @param snippetId defines the snippet to load\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns a promise that will resolve on success\r\n */\r\n public static async ParseFromSnippetAsync(\r\n snippetId: string,\r\n scaleToSize?: boolean,\r\n appendToAdt?: AdvancedDynamicTexture,\r\n urlRewriter?: (url: string) => string\r\n ): Promise<AdvancedDynamicTexture> {\r\n const adt = appendToAdt ?? AdvancedDynamicTexture.CreateFullscreenUI(\"ADT from snippet\");\r\n if (snippetId === \"_BLANK\") {\r\n return adt;\r\n }\r\n\r\n const serialized = await AdvancedDynamicTexture._LoadURLContentAsync(AdvancedDynamicTexture.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"), true);\r\n adt.parseSerializedObject(serialized, scaleToSize, urlRewriter);\r\n return adt;\r\n }\r\n\r\n /**\r\n * Recreate the content of the ADT from a snippet saved by the GUI editor\r\n * @param snippetId defines the snippet to load\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns a promise that will resolve on success\r\n */\r\n public parseFromSnippetAsync(snippetId: string, scaleToSize?: boolean, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture> {\r\n return AdvancedDynamicTexture.ParseFromSnippetAsync(snippetId, scaleToSize, this, urlRewriter);\r\n }\r\n\r\n /**\r\n * Recreate the content of the ADT from a url json\r\n * @param url defines the url to load\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param appendToAdt if provided the snippet will be appended to the adt. Otherwise a fullscreen ADT will be created.\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns a promise that will resolve on success\r\n */\r\n public static async ParseFromFileAsync(\r\n url: string,\r\n scaleToSize?: boolean,\r\n appendToAdt?: AdvancedDynamicTexture,\r\n urlRewriter?: (url: string) => string\r\n ): Promise<AdvancedDynamicTexture> {\r\n const adt = appendToAdt ?? AdvancedDynamicTexture.CreateFullscreenUI(\"ADT from URL\");\r\n const serialized = await AdvancedDynamicTexture._LoadURLContentAsync(url);\r\n adt.parseSerializedObject(serialized, scaleToSize, urlRewriter);\r\n return adt;\r\n }\r\n\r\n /**\r\n * Recreate the content of the ADT from a url json\r\n * @param url defines the url to load\r\n * @param scaleToSize defines whether to scale to texture to the saved size\r\n * @param urlRewriter defines an url rewriter to update urls before sending them to the controls\r\n * @returns a promise that will resolve on success\r\n */\r\n public parseFromURLAsync(url: string, scaleToSize?: boolean, urlRewriter?: (url: string) => string): Promise<AdvancedDynamicTexture> {\r\n return AdvancedDynamicTexture.ParseFromFileAsync(url, scaleToSize, this, urlRewriter);\r\n }\r\n\r\n private static _LoadURLContentAsync(url: string, snippet: boolean = false): Promise<any> {\r\n if (url === \"\") {\r\n return Promise.reject(\"No URL provided\");\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n let gui;\r\n if (snippet) {\r\n const payload = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n gui = payload.encodedGui ? new TextDecoder(\"utf-8\").decode(DecodeBase64ToBinary(payload.encodedGui)) : payload.gui;\r\n } else {\r\n gui = request.responseText;\r\n }\r\n const serializationObject = JSON.parse(gui);\r\n resolve(serializationObject);\r\n } else {\r\n reject(\"Unable to load\");\r\n }\r\n }\r\n });\r\n request.open(\"GET\", url);\r\n request.send();\r\n });\r\n }\r\n\r\n // Statics\r\n /**\r\n * Compares two rectangle based controls for pixel overlap\r\n * @param control1 The first control to compare\r\n * @param control2 The second control to compare\r\n * @returns true if overlaps, otherwise false\r\n */\r\n private static _Overlaps(control1: Control, control2: Control) {\r\n return !(\r\n control1.centerX > control2.centerX + control2.widthInPixels ||\r\n control1.centerX + control1.widthInPixels < control2.centerX ||\r\n control1.centerY + control1.heightInPixels < control2.centerY ||\r\n control1.centerY > control2.centerY + control2.heightInPixels\r\n );\r\n }\r\n\r\n /**\r\n * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)\r\n * @param mesh defines the mesh which will receive the texture\r\n * @param width defines the texture width (1024 by default)\r\n * @param height defines the texture height (1024 by default)\r\n * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)\r\n * @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)\r\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\r\n * @param materialSetupCallback defines a custom way of creating and setting up the material on the mesh\r\n * @param sampling defines the texture sampling mode (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @returns a new AdvancedDynamicTexture\r\n */\r\n public static CreateForMesh(\r\n mesh: AbstractMesh,\r\n width = 1024,\r\n height = 1024,\r\n supportPointerMove = true,\r\n onlyAlphaTesting = false,\r\n invertY?: boolean,\r\n materialSetupCallback: (mesh: AbstractMesh, uniqueId: string, texture: AdvancedDynamicTexture, onlyAlphaTesting: boolean) => void = this._CreateMaterial,\r\n sampling = Texture.TRILINEAR_SAMPLINGMODE\r\n ): AdvancedDynamicTexture {\r\n // use a unique ID in name so serialization will work even if you create two ADTs for a single mesh\r\n const uniqueId = RandomGUID();\r\n const result = new AdvancedDynamicTexture(`AdvancedDynamicTexture for ${mesh.name} [${uniqueId}]`, width, height, mesh.getScene(), true, sampling, invertY);\r\n\r\n materialSetupCallback(mesh, uniqueId, result, onlyAlphaTesting);\r\n\r\n result.attachToMesh(mesh, supportPointerMove);\r\n return result;\r\n }\r\n\r\n private static _CreateMaterial(mesh: AbstractMesh, uniqueId: string, texture: AdvancedDynamicTexture, onlyAlphaTesting: boolean): void {\r\n const internalClassType = GetClass(\"BABYLON.StandardMaterial\");\r\n if (!internalClassType) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"StandardMaterial needs to be imported before as it contains a side-effect required by your code.\";\r\n }\r\n\r\n const material: StandardMaterial = new internalClassType(`AdvancedDynamicTextureMaterial for ${mesh.name} [${uniqueId}]`, mesh.getScene());\r\n material.backFaceCulling = false;\r\n material.diffuseColor = Color3.Black();\r\n material.specularColor = Color3.Black();\r\n if (onlyAlphaTesting) {\r\n material.diffuseTexture = texture;\r\n material.emissiveTexture = texture;\r\n texture.hasAlpha = true;\r\n } else {\r\n material.emissiveTexture = texture;\r\n material.opacityTexture = texture;\r\n }\r\n mesh.material = material;\r\n }\r\n\r\n /**\r\n * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) BUT do not create a new material for the mesh. You will be responsible for connecting the texture\r\n * @param mesh defines the mesh which will receive the texture\r\n * @param width defines the texture width (1024 by default)\r\n * @param height defines the texture height (1024 by default)\r\n * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)\r\n * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)\r\n * @param sampling defines the texture sampling mode (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @returns a new AdvancedDynamicTexture\r\n */\r\n public static CreateForMeshTexture(\r\n mesh: AbstractMesh,\r\n width = 1024,\r\n height = 1024,\r\n supportPointerMove = true,\r\n invertY?: boolean,\r\n sampling = Texture.TRILINEAR_SAMPLINGMODE\r\n ): AdvancedDynamicTexture {\r\n const result = new AdvancedDynamicTexture(mesh.name + \" AdvancedDynamicTexture\", width, height, mesh.getScene(), true, sampling, invertY);\r\n result.attachToMesh(mesh, supportPointerMove);\r\n return result;\r\n }\r\n /**\r\n * Creates a new AdvancedDynamicTexture in fullscreen mode.\r\n * In this mode the texture will rely on a layer for its rendering.\r\n * This allows it to be treated like any other layer.\r\n * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.\r\n * LayerMask is set through advancedTexture.layer.layerMask\r\n * @param name defines name for the texture\r\n * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)\r\n * @param sceneOrOptions defines the hosting scene or options (IAdvancedDynamicTextureOptions)\r\n * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)\r\n * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)\r\n * @returns a new AdvancedDynamicTexture\r\n */\r\n public static CreateFullscreenUI(\r\n name: string,\r\n foreground: boolean = true,\r\n sceneOrOptions: Nullable<Scene> | IAdvancedDynamicTextureOptions = null,\r\n sampling = Texture.BILINEAR_SAMPLINGMODE,\r\n adaptiveScaling: boolean = false\r\n ): AdvancedDynamicTexture {\r\n const isScene = !sceneOrOptions || (sceneOrOptions as Scene)._isScene;\r\n const result = isScene\r\n ? new AdvancedDynamicTexture(name, 0, 0, sceneOrOptions as Scene, false, sampling)\r\n : new AdvancedDynamicTexture(name, sceneOrOptions as IAdvancedDynamicTextureOptions);\r\n // Display\r\n const resultScene = result.getScene();\r\n const layer = new Layer(name + \"_layer\", null, resultScene, !foreground);\r\n layer.texture = result;\r\n result._layerToDispose = layer;\r\n result._isFullscreen = true;\r\n\r\n if (result.useStandalone) {\r\n // Make sure the layer is not rendered by the layer component!\r\n layer.layerMask = 0;\r\n }\r\n\r\n if (adaptiveScaling && resultScene) {\r\n const newScale = 1 / resultScene.getEngine().getHardwareScalingLevel();\r\n result._rootContainer.scaleX = newScale;\r\n result._rootContainer.scaleY = newScale;\r\n }\r\n\r\n // Attach\r\n result.attach();\r\n return result;\r\n }\r\n\r\n /**\r\n * Scales the texture\r\n * @param ratio the scale factor to apply to both width and height\r\n */\r\n public override scale(ratio: number): void {\r\n super.scale(ratio);\r\n this.markAsDirty();\r\n }\r\n\r\n /**\r\n * Resizes the texture\r\n * @param width the new width\r\n * @param height the new height\r\n */\r\n public override scaleTo(width: number, height: number): void {\r\n super.scaleTo(width, height);\r\n this.markAsDirty();\r\n }\r\n\r\n private _checkGuiIsReady() {\r\n if (this.guiIsReady()) {\r\n this.onGuiReadyObservable.notifyObservers(this);\r\n\r\n this.onGuiReadyObservable.clear();\r\n }\r\n }\r\n\r\n /**\r\n * @returns true if all the GUI components are ready to render\r\n */\r\n public guiIsReady(): boolean {\r\n return this._rootContainer.isReady();\r\n }\r\n}\r\n"]}
package/2D/index.d.ts CHANGED
@@ -4,6 +4,8 @@ export * from "./adtInstrumentation";
4
4
  export * from "./math2D";
5
5
  export * from "./measure";
6
6
  export * from "./multiLinePoint";
7
+ export * from "./FrameGraph/guiTask";
8
+ export * from "./FrameGraph/renderGraphGUIBlock";
7
9
  export * from "./style";
8
10
  export * from "./valueAndUnit";
9
11
  export * from "./xmlLoader";
package/2D/index.js CHANGED
@@ -5,6 +5,8 @@ export * from "./adtInstrumentation.js";
5
5
  export * from "./math2D.js";
6
6
  export * from "./measure.js";
7
7
  export * from "./multiLinePoint.js";
8
+ export * from "./FrameGraph/guiTask.js";
9
+ export * from "./FrameGraph/renderGraphGUIBlock.js";
8
10
  export * from "./style.js";
9
11
  export * from "./valueAndUnit.js";
10
12
  export * from "./xmlLoader.js";
package/2D/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/gui/src/2D/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,kBAAkB,CAAC;AAEjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./controls/index\";\r\n\r\nexport * from \"./advancedDynamicTexture\";\r\nexport * from \"./adtInstrumentation\";\r\nexport * from \"./math2D\";\r\nexport * from \"./measure\";\r\nexport * from \"./multiLinePoint\";\r\nexport * from \"./style\";\r\nexport * from \"./valueAndUnit\";\r\nexport * from \"./xmlLoader\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/gui/src/2D/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,kBAAkB,CAAC;AAEjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./controls/index\";\r\n\r\nexport * from \"./advancedDynamicTexture\";\r\nexport * from \"./adtInstrumentation\";\r\nexport * from \"./math2D\";\r\nexport * from \"./measure\";\r\nexport * from \"./multiLinePoint\";\r\nexport * from \"./FrameGraph/guiTask\";\r\nexport * from \"./FrameGraph/renderGraphGUIBlock\";\r\nexport * from \"./style\";\r\nexport * from \"./valueAndUnit\";\r\nexport * from \"./xmlLoader\";\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/gui",
3
- "version": "7.32.0",
3
+ "version": "7.32.2",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "postcompile": "build-tools -c add-js-to-es6"
19
19
  },
20
20
  "devDependencies": {
21
- "@babylonjs/core": "^7.32.0",
21
+ "@babylonjs/core": "^7.32.2",
22
22
  "@dev/build-tools": "^1.0.0",
23
23
  "@lts/gui": "1.0.0"
24
24
  },