@babylonjs/gui 9.12.1 → 9.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2D/FrameGraph/pure.d.ts +2 -0
- package/2D/FrameGraph/pure.js +3 -0
- package/2D/FrameGraph/pure.js.map +1 -0
- package/2D/FrameGraph/renderGraphGUIBlock.d.ts +3 -41
- package/2D/FrameGraph/renderGraphGUIBlock.js +5 -64
- package/2D/FrameGraph/renderGraphGUIBlock.js.map +1 -1
- package/2D/FrameGraph/renderGraphGUIBlock.pure.d.ts +48 -0
- package/2D/FrameGraph/renderGraphGUIBlock.pure.js +78 -0
- package/2D/FrameGraph/renderGraphGUIBlock.pure.js.map +1 -0
- package/2D/controls/button.d.ts +3 -107
- package/2D/controls/button.js +5 -243
- package/2D/controls/button.js.map +1 -1
- package/2D/controls/button.pure.d.ts +114 -0
- package/2D/controls/button.pure.js +257 -0
- package/2D/controls/button.pure.js.map +1 -0
- package/2D/controls/checkbox.d.ts +3 -51
- package/2D/controls/checkbox.js +5 -161
- package/2D/controls/checkbox.js.map +1 -1
- package/2D/controls/checkbox.pure.d.ts +58 -0
- package/2D/controls/checkbox.pure.js +175 -0
- package/2D/controls/checkbox.pure.js.map +1 -0
- package/2D/controls/colorpicker.d.ts +5 -101
- package/2D/controls/colorpicker.js +7 -1394
- package/2D/controls/colorpicker.js.map +1 -1
- package/2D/controls/colorpicker.pure.d.ts +106 -0
- package/2D/controls/colorpicker.pure.js +1406 -0
- package/2D/controls/colorpicker.pure.js.map +1 -0
- package/2D/controls/container.d.ts +3 -177
- package/2D/controls/container.js +5 -615
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/container.pure.d.ts +184 -0
- package/2D/controls/container.pure.js +629 -0
- package/2D/controls/container.pure.js.map +1 -0
- package/2D/controls/control.d.ts +3 -944
- package/2D/controls/control.js +5 -2457
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/control.pure.d.ts +951 -0
- package/2D/controls/control.pure.js +2471 -0
- package/2D/controls/control.pure.js.map +1 -0
- package/2D/controls/displayGrid.d.ts +5 -53
- package/2D/controls/displayGrid.js +7 -201
- package/2D/controls/displayGrid.js.map +1 -1
- package/2D/controls/displayGrid.pure.d.ts +58 -0
- package/2D/controls/displayGrid.pure.js +213 -0
- package/2D/controls/displayGrid.pure.js.map +1 -0
- package/2D/controls/ellipse.d.ts +5 -25
- package/2D/controls/ellipse.js +7 -92
- package/2D/controls/ellipse.js.map +1 -1
- package/2D/controls/ellipse.pure.d.ts +30 -0
- package/2D/controls/ellipse.pure.js +104 -0
- package/2D/controls/ellipse.pure.js.map +1 -0
- package/2D/controls/focusableButton.d.ts +3 -15
- package/2D/controls/focusableButton.js +5 -22
- package/2D/controls/focusableButton.js.map +1 -1
- package/2D/controls/focusableButton.pure.d.ts +22 -0
- package/2D/controls/focusableButton.pure.js +36 -0
- package/2D/controls/focusableButton.pure.js.map +1 -0
- package/2D/controls/gradient/LinearGradient.d.ts +3 -43
- package/2D/controls/gradient/LinearGradient.js +5 -70
- package/2D/controls/gradient/LinearGradient.js.map +1 -1
- package/2D/controls/gradient/LinearGradient.pure.d.ts +50 -0
- package/2D/controls/gradient/LinearGradient.pure.js +84 -0
- package/2D/controls/gradient/LinearGradient.pure.js.map +1 -0
- package/2D/controls/gradient/RadialGradient.d.ts +3 -51
- package/2D/controls/gradient/RadialGradient.js +5 -86
- package/2D/controls/gradient/RadialGradient.js.map +1 -1
- package/2D/controls/gradient/RadialGradient.pure.d.ts +58 -0
- package/2D/controls/gradient/RadialGradient.pure.js +100 -0
- package/2D/controls/gradient/RadialGradient.pure.js.map +1 -0
- package/2D/controls/gradient/pure.d.ts +3 -0
- package/2D/controls/gradient/pure.js +4 -0
- package/2D/controls/gradient/pure.js.map +1 -0
- package/2D/controls/grid.d.ts +3 -149
- package/2D/controls/grid.js +5 -525
- package/2D/controls/grid.js.map +1 -1
- package/2D/controls/grid.pure.d.ts +156 -0
- package/2D/controls/grid.pure.js +539 -0
- package/2D/controls/grid.pure.js.map +1 -0
- package/2D/controls/image.d.ts +3 -226
- package/2D/controls/image.js +5 -913
- package/2D/controls/image.js.map +1 -1
- package/2D/controls/image.pure.d.ts +233 -0
- package/2D/controls/image.pure.js +927 -0
- package/2D/controls/image.pure.js.map +1 -0
- package/2D/controls/inputPassword.d.ts +3 -7
- package/2D/controls/inputPassword.js +5 -19
- package/2D/controls/inputPassword.js.map +1 -1
- package/2D/controls/inputPassword.pure.d.ts +14 -0
- package/2D/controls/inputPassword.pure.js +33 -0
- package/2D/controls/inputPassword.pure.js.map +1 -0
- package/2D/controls/inputText.d.ts +3 -202
- package/2D/controls/inputText.js +5 -1050
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/inputText.pure.d.ts +209 -0
- package/2D/controls/inputText.pure.js +1064 -0
- package/2D/controls/inputText.pure.js.map +1 -0
- package/2D/controls/inputTextArea.d.ts +3 -140
- package/2D/controls/inputTextArea.js +5 -1023
- package/2D/controls/inputTextArea.js.map +1 -1
- package/2D/controls/inputTextArea.pure.d.ts +147 -0
- package/2D/controls/inputTextArea.pure.js +1037 -0
- package/2D/controls/inputTextArea.pure.js.map +1 -0
- package/2D/controls/line.d.ts +5 -74
- package/2D/controls/line.js +7 -234
- package/2D/controls/line.js.map +1 -1
- package/2D/controls/line.pure.d.ts +79 -0
- package/2D/controls/line.pure.js +246 -0
- package/2D/controls/line.pure.js.map +1 -0
- package/2D/controls/multiLine.d.ts +3 -73
- package/2D/controls/multiLine.js +5 -234
- package/2D/controls/multiLine.js.map +1 -1
- package/2D/controls/multiLine.pure.d.ts +80 -0
- package/2D/controls/multiLine.pure.js +248 -0
- package/2D/controls/multiLine.pure.js.map +1 -0
- package/2D/controls/pure.d.ts +38 -0
- package/2D/controls/pure.js +39 -0
- package/2D/controls/pure.js.map +1 -0
- package/2D/controls/radioButton.d.ts +3 -47
- package/2D/controls/radioButton.js +5 -182
- package/2D/controls/radioButton.js.map +1 -1
- package/2D/controls/radioButton.pure.d.ts +54 -0
- package/2D/controls/radioButton.pure.js +196 -0
- package/2D/controls/radioButton.pure.js.map +1 -0
- package/2D/controls/rectangle.d.ts +5 -43
- package/2D/controls/rectangle.js +7 -205
- package/2D/controls/rectangle.js.map +1 -1
- package/2D/controls/rectangle.pure.d.ts +48 -0
- package/2D/controls/rectangle.pure.js +217 -0
- package/2D/controls/rectangle.pure.js.map +1 -0
- package/2D/controls/scrollViewers/pure.d.ts +2 -0
- package/2D/controls/scrollViewers/pure.js +3 -0
- package/2D/controls/scrollViewers/pure.js.map +1 -0
- package/2D/controls/scrollViewers/scrollViewer.d.ts +3 -176
- package/2D/controls/scrollViewers/scrollViewer.js +5 -584
- package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.pure.d.ts +183 -0
- package/2D/controls/scrollViewers/scrollViewer.pure.js +598 -0
- package/2D/controls/scrollViewers/scrollViewer.pure.js.map +1 -0
- package/2D/controls/sliders/imageBasedSlider.d.ts +3 -45
- package/2D/controls/sliders/imageBasedSlider.js +5 -165
- package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.pure.d.ts +52 -0
- package/2D/controls/sliders/imageBasedSlider.pure.js +179 -0
- package/2D/controls/sliders/imageBasedSlider.pure.js.map +1 -0
- package/2D/controls/sliders/pure.d.ts +4 -0
- package/2D/controls/sliders/pure.js +5 -0
- package/2D/controls/sliders/pure.js.map +1 -0
- package/2D/controls/sliders/scrollBar.d.ts +3 -48
- package/2D/controls/sliders/scrollBar.js +5 -170
- package/2D/controls/sliders/scrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.pure.d.ts +55 -0
- package/2D/controls/sliders/scrollBar.pure.js +184 -0
- package/2D/controls/sliders/scrollBar.pure.js.map +1 -0
- package/2D/controls/sliders/slider.d.ts +3 -44
- package/2D/controls/sliders/slider.js +5 -278
- package/2D/controls/sliders/slider.js.map +1 -1
- package/2D/controls/sliders/slider.pure.d.ts +51 -0
- package/2D/controls/sliders/slider.pure.js +292 -0
- package/2D/controls/sliders/slider.pure.js.map +1 -0
- package/2D/controls/stackPanel.d.ts +3 -62
- package/2D/controls/stackPanel.js +5 -243
- package/2D/controls/stackPanel.js.map +1 -1
- package/2D/controls/stackPanel.pure.d.ts +69 -0
- package/2D/controls/stackPanel.pure.js +257 -0
- package/2D/controls/stackPanel.pure.js.map +1 -0
- package/2D/controls/statics.d.ts +3 -4
- package/2D/controls/statics.js +5 -47
- package/2D/controls/statics.js.map +1 -1
- package/2D/controls/statics.pure.d.ts +11 -0
- package/2D/controls/statics.pure.js +61 -0
- package/2D/controls/statics.pure.js.map +1 -0
- package/2D/controls/textBlock.d.ts +3 -217
- package/2D/controls/textBlock.js +5 -676
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/controls/textBlock.pure.d.ts +224 -0
- package/2D/controls/textBlock.pure.js +690 -0
- package/2D/controls/textBlock.pure.js.map +1 -0
- package/2D/controls/toggleButton.d.ts +3 -91
- package/2D/controls/toggleButton.js +5 -226
- package/2D/controls/toggleButton.js.map +1 -1
- package/2D/controls/toggleButton.pure.d.ts +98 -0
- package/2D/controls/toggleButton.pure.js +240 -0
- package/2D/controls/toggleButton.pure.js.map +1 -0
- package/2D/controls/virtualKeyboard.d.ts +3 -100
- package/2D/controls/virtualKeyboard.js +5 -272
- package/2D/controls/virtualKeyboard.js.map +1 -1
- package/2D/controls/virtualKeyboard.pure.d.ts +107 -0
- package/2D/controls/virtualKeyboard.pure.js +286 -0
- package/2D/controls/virtualKeyboard.pure.js.map +1 -0
- package/2D/pure.d.ts +13 -0
- package/2D/pure.js +15 -0
- package/2D/pure.js.map +1 -0
- package/3D/controls/pure.d.ts +23 -0
- package/3D/controls/pure.js +24 -0
- package/3D/controls/pure.js.map +1 -0
- package/3D/gizmos/pure.d.ts +3 -0
- package/3D/gizmos/pure.js +4 -0
- package/3D/gizmos/pure.js.map +1 -0
- package/3D/materials/fluent/fluentMaterial.d.ts +5 -100
- package/3D/materials/fluent/fluentMaterial.js +7 -305
- package/3D/materials/fluent/fluentMaterial.js.map +1 -1
- package/3D/materials/fluent/fluentMaterial.pure.d.ts +105 -0
- package/3D/materials/fluent/fluentMaterial.pure.js +317 -0
- package/3D/materials/fluent/fluentMaterial.pure.js.map +1 -0
- package/3D/materials/fluent/pure.d.ts +2 -0
- package/3D/materials/fluent/pure.js +3 -0
- package/3D/materials/fluent/pure.js.map +1 -0
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.d.ts +5 -164
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +7 -488
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.d.ts +169 -0
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js +500 -0
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js.map +1 -0
- package/3D/materials/fluentBackplate/pure.d.ts +2 -0
- package/3D/materials/fluentBackplate/pure.js +3 -0
- package/3D/materials/fluentBackplate/pure.js.map +1 -0
- package/3D/materials/fluentButton/fluentButtonMaterial.d.ts +5 -200
- package/3D/materials/fluentButton/fluentButtonMaterial.js +7 -563
- package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.pure.d.ts +205 -0
- package/3D/materials/fluentButton/fluentButtonMaterial.pure.js +575 -0
- package/3D/materials/fluentButton/fluentButtonMaterial.pure.js.map +1 -0
- package/3D/materials/fluentButton/pure.d.ts +2 -0
- package/3D/materials/fluentButton/pure.js +3 -0
- package/3D/materials/fluentButton/pure.js.map +1 -0
- package/3D/materials/handle/handleMaterial.d.ts +5 -66
- package/3D/materials/handle/handleMaterial.js +5 -118
- package/3D/materials/handle/handleMaterial.js.map +1 -1
- package/3D/materials/handle/handleMaterial.pure.d.ts +66 -0
- package/3D/materials/handle/handleMaterial.pure.js +119 -0
- package/3D/materials/handle/handleMaterial.pure.js.map +1 -0
- package/3D/materials/handle/pure.d.ts +2 -0
- package/3D/materials/handle/pure.js +3 -0
- package/3D/materials/handle/pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlBackglowMaterial.d.ts +5 -85
- package/3D/materials/mrdl/mrdlBackglowMaterial.js +7 -299
- package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackglowMaterial.pure.d.ts +90 -0
- package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js +311 -0
- package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlBackplateMaterial.d.ts +5 -145
- package/3D/materials/mrdl/mrdlBackplateMaterial.js +7 -433
- package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.pure.d.ts +157 -0
- package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js +452 -0
- package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlFrontplateMaterial.d.ts +5 -183
- package/3D/materials/mrdl/mrdlFrontplateMaterial.js +7 -532
- package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.d.ts +188 -0
- package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js +544 -0
- package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlInnerquadMaterial.d.ts +5 -54
- package/3D/materials/mrdl/mrdlInnerquadMaterial.js +7 -227
- package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.d.ts +59 -0
- package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js +239 -0
- package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlSliderBarMaterial.d.ts +5 -334
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js +7 -855
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.d.ts +346 -0
- package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js +874 -0
- package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.d.ts +5 -334
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +7 -855
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.d.ts +346 -0
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js +874 -0
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/pure.d.ts +7 -0
- package/3D/materials/mrdl/pure.js +8 -0
- package/3D/materials/mrdl/pure.js.map +1 -0
- package/3D/materials/pure.d.ts +6 -0
- package/3D/materials/pure.js +8 -0
- package/3D/materials/pure.js.map +1 -0
- package/3D/pure.d.ts +6 -0
- package/3D/pure.js +8 -0
- package/3D/pure.js.map +1 -0
- package/package.json +50 -3
- package/pure.d.ts +3 -0
- package/pure.js +5 -0
- package/pure.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/FrameGraph/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,4BAA4B,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\nexport * from \"./renderGraphGUIBlock.pure\";\n"]}
|
|
@@ -1,43 +1,5 @@
|
|
|
1
|
-
import { NodeRenderGraphBlock } from "@babylonjs/core/FrameGraph/Node/nodeRenderGraphBlock.js";
|
|
2
|
-
import { AdvancedDynamicTexture } from "../advancedDynamicTexture.js";
|
|
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.js";
|
|
7
|
-
import { type FrameGraph } from "@babylonjs/core/FrameGraph/frameGraph.js";
|
|
8
1
|
/**
|
|
9
|
-
*
|
|
2
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
3
|
+
* Import "./renderGraphGUIBlock.pure" for tree-shakeable, side-effect-free usage.
|
|
10
4
|
*/
|
|
11
|
-
export
|
|
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 target input component
|
|
36
|
-
*/
|
|
37
|
-
get target(): NodeRenderGraphConnectionPoint;
|
|
38
|
-
/**
|
|
39
|
-
* Gets the output component
|
|
40
|
-
*/
|
|
41
|
-
get output(): NodeRenderGraphConnectionPoint;
|
|
42
|
-
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
43
|
-
}
|
|
5
|
+
export * from "./renderGraphGUIBlock.pure.js";
|
|
@@ -1,67 +1,8 @@
|
|
|
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
1
|
/**
|
|
7
|
-
*
|
|
2
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
3
|
+
* Import "./renderGraphGUIBlock.pure" for tree-shakeable, side-effect-free usage.
|
|
8
4
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
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("target", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
31
|
-
this._addDependenciesInput();
|
|
32
|
-
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
33
|
-
this.target.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
34
|
-
this.output._typeConnectionSource = this.target;
|
|
35
|
-
this._gui = AdvancedDynamicTexture.CreateFullscreenUI(this.name, undefined, {
|
|
36
|
-
useStandalone: true,
|
|
37
|
-
scene,
|
|
38
|
-
});
|
|
39
|
-
this._frameGraphTask = new FrameGraphGUITask(this.name, frameGraph, this._gui);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Gets the current class name
|
|
43
|
-
* @returns the class name
|
|
44
|
-
*/
|
|
45
|
-
getClassName() {
|
|
46
|
-
return "GUI.NodeRenderGraphGUIBlock";
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Gets the target input component
|
|
50
|
-
*/
|
|
51
|
-
get target() {
|
|
52
|
-
return this._inputs[0];
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Gets the output component
|
|
56
|
-
*/
|
|
57
|
-
get output() {
|
|
58
|
-
return this._outputs[0];
|
|
59
|
-
}
|
|
60
|
-
_buildBlock(state) {
|
|
61
|
-
super._buildBlock(state);
|
|
62
|
-
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
63
|
-
this._frameGraphTask.targetTexture = this.target.connectedPoint?.value;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
RegisterClass("BABYLON.GUI.NodeRenderGraphGUIBlock", NodeRenderGraphGUIBlock);
|
|
5
|
+
export * from "./renderGraphGUIBlock.pure.js";
|
|
6
|
+
import { RegisterNodeRenderGraphGUIBlock } from "./renderGraphGUIBlock.pure.js";
|
|
7
|
+
RegisterNodeRenderGraphGUIBlock();
|
|
67
8
|
//# sourceMappingURL=renderGraphGUIBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderGraphGUIBlock.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/FrameGraph/renderGraphGUIBlock.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"renderGraphGUIBlock.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/FrameGraph/renderGraphGUIBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,4BAA4B,CAAC;AAE3C,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,+BAA+B,EAAE,CAAC","sourcesContent":["/**\r\n * Re-exports the pure implementation and applies the runtime registration side effect.\r\n * Import \"./renderGraphGUIBlock.pure\" for tree-shakeable, side-effect-free usage.\r\n */\r\nexport * from \"./renderGraphGUIBlock.pure\";\r\n\r\nimport { RegisterNodeRenderGraphGUIBlock } from \"./renderGraphGUIBlock.pure\";\r\nRegisterNodeRenderGraphGUIBlock();\r\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { NodeRenderGraphBlock } from "@babylonjs/core/FrameGraph/Node/nodeRenderGraphBlock.js";
|
|
2
|
+
import { AdvancedDynamicTexture } from "../advancedDynamicTexture.js";
|
|
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.js";
|
|
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 target input component
|
|
36
|
+
*/
|
|
37
|
+
get target(): NodeRenderGraphConnectionPoint;
|
|
38
|
+
/**
|
|
39
|
+
* Gets the output component
|
|
40
|
+
*/
|
|
41
|
+
get output(): NodeRenderGraphConnectionPoint;
|
|
42
|
+
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Registers the NodeRenderGraphGUIBlock class with the type store for serialization support.
|
|
46
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
47
|
+
*/
|
|
48
|
+
export declare function RegisterNodeRenderGraphGUIBlock(): void;
|
|
@@ -0,0 +1,78 @@
|
|
|
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("target", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
31
|
+
this._addDependenciesInput();
|
|
32
|
+
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
33
|
+
this.target.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
34
|
+
this.output._typeConnectionSource = this.target;
|
|
35
|
+
this._gui = AdvancedDynamicTexture.CreateFullscreenUI(this.name, undefined, {
|
|
36
|
+
useStandalone: true,
|
|
37
|
+
scene,
|
|
38
|
+
});
|
|
39
|
+
this._frameGraphTask = new FrameGraphGUITask(this.name, frameGraph, this._gui);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Gets the current class name
|
|
43
|
+
* @returns the class name
|
|
44
|
+
*/
|
|
45
|
+
getClassName() {
|
|
46
|
+
return "GUI.NodeRenderGraphGUIBlock";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the target input component
|
|
50
|
+
*/
|
|
51
|
+
get target() {
|
|
52
|
+
return this._inputs[0];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Gets the output component
|
|
56
|
+
*/
|
|
57
|
+
get output() {
|
|
58
|
+
return this._outputs[0];
|
|
59
|
+
}
|
|
60
|
+
_buildBlock(state) {
|
|
61
|
+
super._buildBlock(state);
|
|
62
|
+
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
63
|
+
this._frameGraphTask.targetTexture = this.target.connectedPoint?.value;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
let _Registered = false;
|
|
67
|
+
/**
|
|
68
|
+
* Registers the NodeRenderGraphGUIBlock class with the type store for serialization support.
|
|
69
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
70
|
+
*/
|
|
71
|
+
export function RegisterNodeRenderGraphGUIBlock() {
|
|
72
|
+
if (_Registered) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
_Registered = true;
|
|
76
|
+
RegisterClass("BABYLON.GUI.NodeRenderGraphGUIBlock", NodeRenderGraphGUIBlock);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=renderGraphGUIBlock.pure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderGraphGUIBlock.pure.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/FrameGraph/renderGraphGUIBlock.pure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,wCAAwC,EAAE,MAAM,iDAAiD,CAAC;AAG3G,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,oBAAoB;IAI7D;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAW,GAAG;QACV,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,wCAAwC,CAAC,YAAY,CAAC,CAAC;QAErF,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,UAAU,CAAC,CAAC;QACjG,IAAI,CAAC,MAAM,CAAC,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC;QAEhD,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE;YACxE,aAAa,EAAE,IAAI;YACnB,KAAK;SACR,CAAC,CAAC;QACH,IAAI,CAAC,eAAe,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACnF,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,6BAA6B,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,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,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,+EAA+E;QAEvI,IAAI,CAAC,eAAe,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,KAAgC,CAAC;IACtG,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,+BAA+B;IAC3C,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,qCAAqC,EAAE,uBAAuB,CAAC,CAAC;AAClF,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(\"target\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.target.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = this.target;\r\n\r\n this._gui = AdvancedDynamicTexture.CreateFullscreenUI(this.name, undefined, {\r\n useStandalone: true,\r\n scene,\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 target input component\r\n */\r\n public get target(): 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.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this._frameGraphTask.targetTexture = this.target.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Registers the NodeRenderGraphGUIBlock class with the type store for serialization support.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterNodeRenderGraphGUIBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.GUI.NodeRenderGraphGUIBlock\", NodeRenderGraphGUIBlock);\r\n}\r\n"]}
|
package/2D/controls/button.d.ts
CHANGED
|
@@ -1,109 +1,5 @@
|
|
|
1
|
-
import { type Nullable } from "@babylonjs/core/types.js";
|
|
2
|
-
import { type Vector2 } from "@babylonjs/core/Maths/math.vector.js";
|
|
3
|
-
import { Rectangle } from "./rectangle.js";
|
|
4
|
-
import { Control } from "./control.js";
|
|
5
|
-
import { TextBlock } from "./textBlock.js";
|
|
6
|
-
import { Image } from "./image.js";
|
|
7
|
-
import { type PointerInfoBase } from "@babylonjs/core/Events/pointerEvents.js";
|
|
8
|
-
import { type AdvancedDynamicTexture } from "../advancedDynamicTexture.js";
|
|
9
|
-
import { type ICanvasRenderingContext } from "@babylonjs/core/Engines/ICanvas.js";
|
|
10
1
|
/**
|
|
11
|
-
*
|
|
2
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
3
|
+
* Import "./button.pure" for tree-shakeable, side-effect-free usage.
|
|
12
4
|
*/
|
|
13
|
-
export
|
|
14
|
-
name?: string | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Function called to generate a pointer enter animation
|
|
17
|
-
*/
|
|
18
|
-
pointerEnterAnimation: () => void;
|
|
19
|
-
/**
|
|
20
|
-
* Function called to generate a pointer out animation
|
|
21
|
-
*/
|
|
22
|
-
pointerOutAnimation: () => void;
|
|
23
|
-
/**
|
|
24
|
-
* Function called to generate a pointer down animation
|
|
25
|
-
*/
|
|
26
|
-
pointerDownAnimation: () => void;
|
|
27
|
-
/**
|
|
28
|
-
* Function called to generate a pointer up animation
|
|
29
|
-
*/
|
|
30
|
-
pointerUpAnimation: () => void;
|
|
31
|
-
private _image;
|
|
32
|
-
/**
|
|
33
|
-
* Returns the image part of the button (if any)
|
|
34
|
-
*/
|
|
35
|
-
get image(): Nullable<Image>;
|
|
36
|
-
private _textBlock;
|
|
37
|
-
/**
|
|
38
|
-
* Returns the TextBlock part of the button (if any)
|
|
39
|
-
*/
|
|
40
|
-
get textBlock(): Nullable<TextBlock>;
|
|
41
|
-
/**
|
|
42
|
-
* Creates a new Button
|
|
43
|
-
* @param name defines the name of the button
|
|
44
|
-
*/
|
|
45
|
-
constructor(name?: string | undefined);
|
|
46
|
-
protected _getTypeName(): string;
|
|
47
|
-
/**
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
_processPicking(x: number, y: number, pi: PointerInfoBase, type: number, pointerId: number, buttonIndex: number, deltaX?: number, deltaY?: number): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
_onPointerEnter(target: Control, pi: PointerInfoBase): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* @internal
|
|
57
|
-
*/
|
|
58
|
-
_onPointerOut(target: Control, pi: PointerInfoBase, force?: boolean): void;
|
|
59
|
-
/**
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
62
|
-
_onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean;
|
|
63
|
-
protected _getRectangleFill(context: ICanvasRenderingContext): string | CanvasGradient;
|
|
64
|
-
/**
|
|
65
|
-
* @internal
|
|
66
|
-
*/
|
|
67
|
-
_onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean, pi: PointerInfoBase): void;
|
|
68
|
-
/**
|
|
69
|
-
* Serializes the current button
|
|
70
|
-
* @param serializationObject defines the JSON serialized object
|
|
71
|
-
* @param force force serialization even if isSerializable === false
|
|
72
|
-
* @param allowCanvas defines if the control is allowed to use a Canvas2D object to serialize
|
|
73
|
-
*/
|
|
74
|
-
serialize(serializationObject: any, force: boolean, allowCanvas: boolean): void;
|
|
75
|
-
/**
|
|
76
|
-
* @internal
|
|
77
|
-
*/
|
|
78
|
-
_parseFromContent(serializedObject: any, host: AdvancedDynamicTexture): void;
|
|
79
|
-
/**
|
|
80
|
-
* Creates a new button made with an image and a text
|
|
81
|
-
* @param name defines the name of the button
|
|
82
|
-
* @param text defines the text of the button
|
|
83
|
-
* @param imageUrl defines the url of the image
|
|
84
|
-
* @returns a new Button
|
|
85
|
-
*/
|
|
86
|
-
static CreateImageButton(name: string, text: string, imageUrl: string): Button;
|
|
87
|
-
/**
|
|
88
|
-
* Creates a new button made with an image
|
|
89
|
-
* @param name defines the name of the button
|
|
90
|
-
* @param imageUrl defines the url of the image
|
|
91
|
-
* @returns a new Button
|
|
92
|
-
*/
|
|
93
|
-
static CreateImageOnlyButton(name: string, imageUrl: string): Button;
|
|
94
|
-
/**
|
|
95
|
-
* Creates a new button made with a text
|
|
96
|
-
* @param name defines the name of the button
|
|
97
|
-
* @param text defines the text of the button
|
|
98
|
-
* @returns a new Button
|
|
99
|
-
*/
|
|
100
|
-
static CreateSimpleButton(name: string, text: string): Button;
|
|
101
|
-
/**
|
|
102
|
-
* Creates a new button made with an image and a centered text
|
|
103
|
-
* @param name defines the name of the button
|
|
104
|
-
* @param text defines the text of the button
|
|
105
|
-
* @param imageUrl defines the url of the image
|
|
106
|
-
* @returns a new Button
|
|
107
|
-
*/
|
|
108
|
-
static CreateImageWithCenterTextButton(name: string, text: string, imageUrl: string): Button;
|
|
109
|
-
}
|
|
5
|
+
export * from "./button.pure.js";
|
package/2D/controls/button.js
CHANGED
|
@@ -1,246 +1,8 @@
|
|
|
1
|
-
import { Rectangle } from "./rectangle.js";
|
|
2
|
-
import { Control } from "./control.js";
|
|
3
|
-
import { TextBlock } from "./textBlock.js";
|
|
4
|
-
import { Image } from "./image.js";
|
|
5
|
-
import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
|
|
6
1
|
/**
|
|
7
|
-
*
|
|
2
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
3
|
+
* Import "./button.pure" for tree-shakeable, side-effect-free usage.
|
|
8
4
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
get image() {
|
|
14
|
-
return this._image;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Returns the TextBlock part of the button (if any)
|
|
18
|
-
*/
|
|
19
|
-
get textBlock() {
|
|
20
|
-
return this._textBlock;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Creates a new Button
|
|
24
|
-
* @param name defines the name of the button
|
|
25
|
-
*/
|
|
26
|
-
constructor(name) {
|
|
27
|
-
super(name);
|
|
28
|
-
this.name = name;
|
|
29
|
-
this.thickness = 1;
|
|
30
|
-
this.isPointerBlocker = true;
|
|
31
|
-
let alphaStore = null;
|
|
32
|
-
this.pointerEnterAnimation = () => {
|
|
33
|
-
alphaStore = this.alpha;
|
|
34
|
-
this.alpha -= 0.1;
|
|
35
|
-
};
|
|
36
|
-
this.pointerOutAnimation = () => {
|
|
37
|
-
if (alphaStore !== null) {
|
|
38
|
-
this.alpha = alphaStore;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
this.pointerDownAnimation = () => {
|
|
42
|
-
this.scaleX -= 0.05;
|
|
43
|
-
this.scaleY -= 0.05;
|
|
44
|
-
};
|
|
45
|
-
this.pointerUpAnimation = () => {
|
|
46
|
-
this.scaleX += 0.05;
|
|
47
|
-
this.scaleY += 0.05;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
_getTypeName() {
|
|
51
|
-
return "Button";
|
|
52
|
-
}
|
|
53
|
-
// While being a container, the button behaves like a control.
|
|
54
|
-
/**
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
_processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
|
|
58
|
-
if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
if (!super.contains(x, y)) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
if (this.delegatePickingToChildren) {
|
|
65
|
-
let contains = false;
|
|
66
|
-
for (let index = this._children.length - 1; index >= 0; index--) {
|
|
67
|
-
const child = this._children[index];
|
|
68
|
-
if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) {
|
|
69
|
-
contains = true;
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
if (!contains) {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* @internal
|
|
82
|
-
*/
|
|
83
|
-
_onPointerEnter(target, pi) {
|
|
84
|
-
if (!super._onPointerEnter(target, pi)) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
if (!this.isReadOnly && this.pointerEnterAnimation) {
|
|
88
|
-
this.pointerEnterAnimation();
|
|
89
|
-
}
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* @internal
|
|
94
|
-
*/
|
|
95
|
-
_onPointerOut(target, pi, force = false) {
|
|
96
|
-
if (!this.isReadOnly && this.pointerOutAnimation) {
|
|
97
|
-
this.pointerOutAnimation();
|
|
98
|
-
}
|
|
99
|
-
super._onPointerOut(target, pi, force);
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* @internal
|
|
103
|
-
*/
|
|
104
|
-
_onPointerDown(target, coordinates, pointerId, buttonIndex, pi) {
|
|
105
|
-
if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
if (!this.isReadOnly && this.pointerDownAnimation) {
|
|
109
|
-
this.pointerDownAnimation();
|
|
110
|
-
}
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
_getRectangleFill(context) {
|
|
114
|
-
if (this.isEnabled) {
|
|
115
|
-
return this._getBackgroundColor(context);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
return this._disabledColor;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* @internal
|
|
123
|
-
*/
|
|
124
|
-
_onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) {
|
|
125
|
-
if (!this.isReadOnly && this.pointerUpAnimation) {
|
|
126
|
-
this.pointerUpAnimation();
|
|
127
|
-
}
|
|
128
|
-
super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi);
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Serializes the current button
|
|
132
|
-
* @param serializationObject defines the JSON serialized object
|
|
133
|
-
* @param force force serialization even if isSerializable === false
|
|
134
|
-
* @param allowCanvas defines if the control is allowed to use a Canvas2D object to serialize
|
|
135
|
-
*/
|
|
136
|
-
serialize(serializationObject, force, allowCanvas) {
|
|
137
|
-
super.serialize(serializationObject, force, allowCanvas);
|
|
138
|
-
if (!this.isSerializable && !force) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
if (this._textBlock) {
|
|
142
|
-
serializationObject.textBlockName = this._textBlock.name;
|
|
143
|
-
}
|
|
144
|
-
if (this._image) {
|
|
145
|
-
serializationObject.imageName = this._image.name;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* @internal
|
|
150
|
-
*/
|
|
151
|
-
_parseFromContent(serializedObject, host) {
|
|
152
|
-
super._parseFromContent(serializedObject, host);
|
|
153
|
-
if (serializedObject.textBlockName) {
|
|
154
|
-
this._textBlock = this.getChildByName(serializedObject.textBlockName);
|
|
155
|
-
}
|
|
156
|
-
if (serializedObject.imageName) {
|
|
157
|
-
this._image = this.getChildByName(serializedObject.imageName);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
// Statics
|
|
161
|
-
/**
|
|
162
|
-
* Creates a new button made with an image and a text
|
|
163
|
-
* @param name defines the name of the button
|
|
164
|
-
* @param text defines the text of the button
|
|
165
|
-
* @param imageUrl defines the url of the image
|
|
166
|
-
* @returns a new Button
|
|
167
|
-
*/
|
|
168
|
-
static CreateImageButton(name, text, imageUrl) {
|
|
169
|
-
const result = new this(name);
|
|
170
|
-
// Adding text
|
|
171
|
-
const textBlock = new TextBlock(name + "_button", text);
|
|
172
|
-
textBlock.textWrapping = true;
|
|
173
|
-
textBlock.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;
|
|
174
|
-
textBlock.paddingLeft = "20%";
|
|
175
|
-
result.addControl(textBlock);
|
|
176
|
-
// Adding image
|
|
177
|
-
const iconImage = new Image(name + "_icon", imageUrl);
|
|
178
|
-
iconImage.width = "20%";
|
|
179
|
-
iconImage.stretch = Image.STRETCH_UNIFORM;
|
|
180
|
-
iconImage.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
181
|
-
result.addControl(iconImage);
|
|
182
|
-
// Store
|
|
183
|
-
result._image = iconImage;
|
|
184
|
-
result._textBlock = textBlock;
|
|
185
|
-
return result;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Creates a new button made with an image
|
|
189
|
-
* @param name defines the name of the button
|
|
190
|
-
* @param imageUrl defines the url of the image
|
|
191
|
-
* @returns a new Button
|
|
192
|
-
*/
|
|
193
|
-
static CreateImageOnlyButton(name, imageUrl) {
|
|
194
|
-
const result = new this(name);
|
|
195
|
-
// Adding image
|
|
196
|
-
const iconImage = new Image(name + "_icon", imageUrl);
|
|
197
|
-
iconImage.stretch = Image.STRETCH_FILL;
|
|
198
|
-
iconImage.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
199
|
-
result.addControl(iconImage);
|
|
200
|
-
// Store
|
|
201
|
-
result._image = iconImage;
|
|
202
|
-
return result;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Creates a new button made with a text
|
|
206
|
-
* @param name defines the name of the button
|
|
207
|
-
* @param text defines the text of the button
|
|
208
|
-
* @returns a new Button
|
|
209
|
-
*/
|
|
210
|
-
static CreateSimpleButton(name, text) {
|
|
211
|
-
const result = new this(name);
|
|
212
|
-
// Adding text
|
|
213
|
-
const textBlock = new TextBlock(name + "_button", text);
|
|
214
|
-
textBlock.textWrapping = true;
|
|
215
|
-
textBlock.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;
|
|
216
|
-
result.addControl(textBlock);
|
|
217
|
-
// Store
|
|
218
|
-
result._textBlock = textBlock;
|
|
219
|
-
return result;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Creates a new button made with an image and a centered text
|
|
223
|
-
* @param name defines the name of the button
|
|
224
|
-
* @param text defines the text of the button
|
|
225
|
-
* @param imageUrl defines the url of the image
|
|
226
|
-
* @returns a new Button
|
|
227
|
-
*/
|
|
228
|
-
static CreateImageWithCenterTextButton(name, text, imageUrl) {
|
|
229
|
-
const result = new this(name);
|
|
230
|
-
// Adding image
|
|
231
|
-
const iconImage = new Image(name + "_icon", imageUrl);
|
|
232
|
-
iconImage.stretch = Image.STRETCH_FILL;
|
|
233
|
-
result.addControl(iconImage);
|
|
234
|
-
// Adding text
|
|
235
|
-
const textBlock = new TextBlock(name + "_button", text);
|
|
236
|
-
textBlock.textWrapping = true;
|
|
237
|
-
textBlock.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;
|
|
238
|
-
result.addControl(textBlock);
|
|
239
|
-
// Store
|
|
240
|
-
result._image = iconImage;
|
|
241
|
-
result._textBlock = textBlock;
|
|
242
|
-
return result;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
RegisterClass("BABYLON.GUI.Button", Button);
|
|
5
|
+
export * from "./button.pure.js";
|
|
6
|
+
import { RegisterButton } from "./button.pure.js";
|
|
7
|
+
RegisterButton();
|
|
246
8
|
//# sourceMappingURL=button.js.map
|