Skip to main content
Version: Phaser v4.0.0-rc.6

Phaser.Display.Canvas

Scope: static

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

Static functions

Static functions

TouchAction

<static> TouchAction(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

<static> UserSelect(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 touch callout value to set on the canvas. Set to none to disable touch callouts.

Returns: HTMLCanvasElement - The canvas element.

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