Phaser API Documentation

  Version: 
<static> disable(context)

Description:

Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. By default browsers have image smoothing enabled, which isn't always what you visually want, especially when using pixel art in a game. Note that this sets the property on the context itself, so that any image drawn to the context will be affected. This sets the property across all current browsers but support is patchy on earlier browsers, especially on mobile.

Parameters:

name type description
context CanvasRenderingContext2D | WebGLRenderingContext

The context on which to disable smoothing.

Returns:
Description:

The provided context.

Type:
  • CanvasRenderingContext2D
  • WebGLRenderingContext
Examples:
Since: 3.0.0