BitmapData#load()

load(source) → {Phaser.BitmapData}

Takes the given Game Object, resizes this BitmapData to match it and then draws it into this BitmapDatas canvas, ready for further processing.
The source game object is not modified by this operation.
If the source object uses a texture as part of a Texture Atlas or Sprite Sheet, only the current frame will be used for sizing.
If a string is given it will assume it's a cache key and look in Phaser.Cache for an image key matching the string.

Parameters
Name Type Description
source Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapData | Image | HTMLCanvasElement | string

The object that will be used to populate this BitmapData. If you give a string it will try and find the Image in the Game.Cache first.

Returns

This BitmapData object for method chaining.

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

Please login to continue.