BitmapData#setPixel()

setPixel(x, y, red, green, blue, immediate) → {Phaser.BitmapData}

Sets the color of the given pixel to the specified red, green and blue values.

Parameters
Name Type Argument Default Description
x number

The x coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.

y number

The y coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.

red number

The red color value, between 0 and 0xFF (255).

green number

The green color value, between 0 and 0xFF (255).

blue number

The blue color value, between 0 and 0xFF (255).

immediate boolean <optional>
true

If true the context.putImageData will be called and the dirty flag set.

Returns

This BitmapData object for method chaining.

Source code: gameobjects/BitmapData.js (Line 967)
doc_phaser
2017-02-14 10:37:13
Comments
Leave a Comment

Please login to continue.