GameObjects.DOMElement.pointerEvents is a new property that allows you to set the pointerEvents attribute on the DOM Element CSS. This is auto by default and should not be changed unless you know what you're doing.

This commit is contained in:
Richard Davey 2021-03-30 10:23:23 +01:00
parent bcd48a25f5
commit b280f3f400
2 changed files with 14 additions and 0 deletions

View file

@ -207,6 +207,19 @@ var DOMElement = new Class({
*/ */
this.rotate3dAngle = 'deg'; this.rotate3dAngle = 'deg';
/**
* Sets the CSS `pointerEvents` attribute on the DOM Element during rendering.
*
* This is 'auto' by default. Changing it may have unintended side-effects with
* internal Phaser input handling, such as dragging, so only change this if you
* understand the implications.
*
* @name Phaser.GameObjects.DOMElement#pointerEvents
* @type {string}
* @since 3.55.0
*/
this.pointerEvents = 'auto';
/** /**
* The native (un-scaled) width of this Game Object. * The native (un-scaled) width of this Game Object.
* *

View file

@ -104,6 +104,7 @@ var DOMElementCSSRenderer = function (renderer, src, camera, parentMatrix)
style.display = 'block'; style.display = 'block';
style.opacity = alpha; style.opacity = alpha;
style.zIndex = src._depth; style.zIndex = src._depth;
style.pointerEvents = src.pointerEvents;
style.mixBlendMode = CSSBlendModes[src._blendMode]; style.mixBlendMode = CSSBlendModes[src._blendMode];
} }