Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: Canvas
Phaser.Display.Canvas

Namespace

Methods

<static> TouchAction(canvas, [value])
Focus
Focus

Description:

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

Parameters:

name type arguments Default description
canvas HTMLCanvasElement

The canvas element to have the style applied to.

value string <optional> 'none'

The touch action value to set on the canvas. Set to none to disable touch actions.

Returns:
Description:

The canvas element.

Type:
  • HTMLCanvasElement
Examples:
Since: 3.0.0
Focus
Focus
<static> UserSelect(canvas, [value])
Focus
Focus

Description:

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

Parameters:

name type arguments Default description
canvas HTMLCanvasElement

The canvas element to have the style applied to.

value string <optional> 'none'

The touch callout value to set on the canvas. Set to none to disable touch callouts.

Returns:
Description:

The canvas element.

Type:
  • HTMLCanvasElement
Examples:
Since: 3.0.0
Focus
Focus