BitmapData#drawFull()

drawFull(parent, blendMode, roundPx) → {Phaser.BitmapData}

Draws the Game Object or Group to this BitmapData and then recursively iterates through all of its children.

If a child has an exists property then it (and its children) will be only be drawn if exists is true.

The children will be drawn at their x and y world space coordinates. If this is outside the bounds of the BitmapData
they won't be drawn. Depending on your requirements you may need to resize the BitmapData in advance to match the
bounds of the top-level Game Object.

When drawing it will take into account the child's world rotation, scale and alpha values.

It's perfectly valid to pass in game.world as the parent object, and it will iterate through the entire display list.

Note: If you are trying to grab your entire game at the start of a State then you should ensure that at least 1 full update
has taken place before doing so, otherwise all of the objects will render with incorrect positions and scales. You can
trigger an update yourself by calling stage.updateTransform() before calling drawFull.

Parameters
Name Type Argument Default Description
parent Phaser.World | Phaser.Group | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText

The Game Object to draw onto this BitmapData and then recursively draw all of its children.

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'.

roundPx boolean <optional>
false

Should the x and y values be rounded to integers before drawing? This prevents anti-aliasing in some instances.

Returns

This BitmapData object for method chaining.

Source code: gameobjects/BitmapData.js (Line 1648)
doc_phaser
2017-02-14 10:36:57
Comments
Leave a Comment

Please login to continue.