|
@@ -76,6 +76,7 @@
|
|
isScreenSpace?: boolean,
|
|
isScreenSpace?: boolean,
|
|
cachingStrategy?: number,
|
|
cachingStrategy?: number,
|
|
enableInteraction?: boolean,
|
|
enableInteraction?: boolean,
|
|
|
|
+ allow3DEventBelowCanvas?: boolean,
|
|
origin?: Vector2,
|
|
origin?: Vector2,
|
|
isVisible?: boolean,
|
|
isVisible?: boolean,
|
|
backgroundRoundRadius?: number,
|
|
backgroundRoundRadius?: number,
|
|
@@ -169,6 +170,8 @@
|
|
this._maxAdaptiveWorldSpaceCanvasSize = null;
|
|
this._maxAdaptiveWorldSpaceCanvasSize = null;
|
|
this._groupCacheMaps = new StringDictionary<MapTexture[]>();
|
|
this._groupCacheMaps = new StringDictionary<MapTexture[]>();
|
|
|
|
|
|
|
|
+ this._changeFlags(SmartPropertyPrim.flagAllow3DEventsBelowCanvas, (settings.allow3DEventBelowCanvas != null) && settings.allow3DEventBelowCanvas);
|
|
|
|
+
|
|
this._patchHierarchy(this);
|
|
this._patchHierarchy(this);
|
|
|
|
|
|
let enableInteraction = (settings.enableInteraction == null) ? true : settings.enableInteraction;
|
|
let enableInteraction = (settings.enableInteraction == null) ? true : settings.enableInteraction;
|
|
@@ -487,6 +490,12 @@
|
|
}
|
|
}
|
|
|
|
|
|
eventState.skipNextObservers = skip;
|
|
eventState.skipNextObservers = skip;
|
|
|
|
+ if (!skip && (this._isFlagSet(SmartPropertyPrim.flagAllow3DEventsBelowCanvas)===false)) {
|
|
|
|
+ eventState.skipNextObservers = true;
|
|
|
|
+ if (eventData instanceof PointerInfoPre) {
|
|
|
|
+ eventData.skipOnPointerObservable = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private _updatePointerInfo(eventData: PointerInfoBase, localPosition: Vector2): boolean {
|
|
private _updatePointerInfo(eventData: PointerInfoBase, localPosition: Vector2): boolean {
|
|
@@ -1062,6 +1071,21 @@
|
|
return this.__engineData;
|
|
return this.__engineData;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * If true is returned, pointerEvent occurring above the Canvas area also sent in 3D scene, if false they are not sent in the 3D Scene
|
|
|
|
+ */
|
|
|
|
+ public get allow3DEventBelowCanvas(): boolean {
|
|
|
|
+ return this._isFlagSet(SmartPropertyPrim.flagAllow3DEventsBelowCanvas);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Set true if you want pointerEvent occurring above the Canvas area to also be sent in the 3D scene.
|
|
|
|
+ * Set false if you don't want the Scene to get the events
|
|
|
|
+ */
|
|
|
|
+ public set allow3DEventBelowCanvas(value: boolean) {
|
|
|
|
+ this._changeFlags(SmartPropertyPrim.flagAllow3DEventsBelowCanvas, value);
|
|
|
|
+ }
|
|
|
|
+
|
|
public createCanvasProfileInfoCanvas(): Canvas2D {
|
|
public createCanvasProfileInfoCanvas(): Canvas2D {
|
|
if (this._profilingCanvas) {
|
|
if (this._profilingCanvas) {
|
|
return this._profilingCanvas;
|
|
return this._profilingCanvas;
|
|
@@ -1817,6 +1841,7 @@
|
|
* - designUseHorizAxis: you can set this member if you use designSize to specify which axis is priority to compute the scale when the ratio of the canvas' size is different from the designSize's one.
|
|
* - designUseHorizAxis: you can set this member if you use designSize to specify which axis is priority to compute the scale when the ratio of the canvas' size is different from the designSize's one.
|
|
* - cachingStrategy: either CACHESTRATEGY_TOPLEVELGROUPS, CACHESTRATEGY_ALLGROUPS, CACHESTRATEGY_CANVAS, CACHESTRATEGY_DONTCACHE. Please refer to their respective documentation for more information. Default is Canvas2D.CACHESTRATEGY_DONTCACHE
|
|
* - cachingStrategy: either CACHESTRATEGY_TOPLEVELGROUPS, CACHESTRATEGY_ALLGROUPS, CACHESTRATEGY_CANVAS, CACHESTRATEGY_DONTCACHE. Please refer to their respective documentation for more information. Default is Canvas2D.CACHESTRATEGY_DONTCACHE
|
|
* - enableInteraction: if true the pointer events will be listened and rerouted to the appropriate primitives of the Canvas2D through the Prim2DBase.onPointerEventObservable observable property. Default is true.
|
|
* - enableInteraction: if true the pointer events will be listened and rerouted to the appropriate primitives of the Canvas2D through the Prim2DBase.onPointerEventObservable observable property. Default is true.
|
|
|
|
+ * - allow3DEventBelowCanvas: by default pointerEvent occurring above the Canvas will prevent to be also sent in the 3D Scene. If you set this setting to true, events will be sent both for Canvas and 3D Scene
|
|
* - isVisible: true if the canvas must be visible, false for hidden. Default is true.
|
|
* - isVisible: true if the canvas must be visible, false for hidden. Default is true.
|
|
* - backgroundRoundRadius: the round radius of the background, either backgroundFill or backgroundBorder must be specified.
|
|
* - backgroundRoundRadius: the round radius of the background, either backgroundFill or backgroundBorder must be specified.
|
|
* - backgroundFill: the brush to use to create a background fill for the canvas. can be a string value (see BABYLON.Canvas2D.GetBrushFromString) or a IBrush2D instance.
|
|
* - backgroundFill: the brush to use to create a background fill for the canvas. can be a string value (see BABYLON.Canvas2D.GetBrushFromString) or a IBrush2D instance.
|
|
@@ -1846,6 +1871,7 @@
|
|
cachingStrategy?: number,
|
|
cachingStrategy?: number,
|
|
cacheBehavior?: number,
|
|
cacheBehavior?: number,
|
|
enableInteraction?: boolean,
|
|
enableInteraction?: boolean,
|
|
|
|
+ allow3DEventBelowCanvas?: boolean,
|
|
isVisible?: boolean,
|
|
isVisible?: boolean,
|
|
backgroundRoundRadius?: number,
|
|
backgroundRoundRadius?: number,
|
|
backgroundFill?: IBrush2D | string,
|
|
backgroundFill?: IBrush2D | string,
|