BitmapData#drawGroup()

drawGroup(group, blendMode, roundPx) → {Phaser.BitmapData}

Draws the immediate children of a Phaser.Group to this BitmapData.

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

Children are drawn only if they have their exists property set to true, and have image, or RenderTexture, based Textures.

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 visible.
When drawing it will take into account the rotation, scale, scaleMode, alpha and tint values.

Note: You should ensure that at least 1 full update has taken place before calling this,
otherwise the objects are likely to render incorrectly, if at all.
You can trigger an update yourself by calling stage.updateTransform() before calling drawGroup.

Parameters
Name Type Argument Default Description
group Phaser.Group

The Group to draw onto this BitmapData. Can also be Phaser.World.

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 1581)
doc_phaser
2017-02-14 10:36:58
Comments
Leave a Comment

Please login to continue.