Video#grab()

grab(clear, alpha, blendMode) → {Phaser.BitmapData}

Grabs the current frame from the Video or Video Stream and renders it to the Video.snapshot BitmapData.

You can optionally set if the BitmapData should be cleared or not, the alpha and the blend mode of the draw.

If you need more advanced control over the grabbing them call Video.snapshot.copy directly with the same parameters as BitmapData.copy.

Parameters
Name Type Argument Default Description
clear boolean <optional>
false

Should the BitmapData be cleared before the Video is grabbed? Unless you are using alpha or a blend mode you can usually leave this set to false.

alpha number <optional>
1

The alpha that will be set on the video before drawing. A value between 0 (fully transparent) and 1, opaque.

blendMode string <optional>
null

The composite blend mode that will be used when drawing. The default is no blend mode at all. This is a Canvas globalCompositeOperation value such as 'lighter' or 'xor'.

Returns

A reference to the Video.snapshot BitmapData object for further method chaining.

Source code: gameobjects/Video.js (Line 1075)
doc_phaser
2017-02-14 11:19:25
Comments
Leave a Comment

Please login to continue.