Phaser API Documentation

  Version: 
createCheckerboard([color1], [color2], [alpha1], [alpha2], [height])

Description:

Creates a checkerboard style texture, based on the given colors and alpha values and applies it to this Plane, replacing any current texture it may have.

The colors are used in an alternating pattern, like a chess board.

Calling this method generates a brand new 16x16 pixel WebGLTexture internally and applies it to this Plane. While quite fast to do, you should still be mindful of calling this method either extensively, or in tight parts of your game.

Parameters:

name type arguments Default description
color1 number <optional> 0xffffff

The odd cell color, specified as a hex value.

color2 number <optional> 0x0000ff

The even cell color, specified as a hex value.

alpha1 number <optional> 255

The odd cell alpha value, specified as a number between 0 and 255.

alpha2 number <optional> 255

The even cell alpha value, specified as a number between 0 and 255.

height number <optional> 128

The view height of the Plane after creation, in pixels.

Since: 3.60.0