You’re reading the docs for Phaser v4.0.0. The latest is Phaser v4.1.0.

Phaser.Display.Canvas

Scope: static

Source: src/display/canvas/index.js#L7

Static functions

Static functions

TouchAction

staticTouchAction(canvas, [value])

Description:

Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions.

Parameters:

nametypeoptionaldefaultdescription
canvasHTMLCanvasElementNoThe canvas element to have the style applied to.
valuestringYes"'none'"The touch action value to set on the canvas. Set to none to disable touch actions.

Returns: HTMLCanvasElement - The canvas element.

Source: src/display/canvas/TouchAction.js#L7
Since: 3.0.0


UserSelect

staticUserSelect(canvas, [value])

Description:

Sets the user-select property on the canvas style. Can be used to disable default browser selection actions.

Parameters:

nametypeoptionaldefaultdescription
canvasHTMLCanvasElementNoThe canvas element to have the style applied to.
valuestringYes"'none'"The user-select value to set on the canvas. Set to none to disable default browser text selection and touch callouts.

Returns: HTMLCanvasElement - The canvas element.

Source: src/display/canvas/UserSelect.js#L7
Since: 3.0.0