Image#Image

new Image(game, x, y, key, frame)

An Image is a light-weight object you can use to display anything that doesn't need physics or animation.
It can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics.

Parameters
Name Type Argument Default Description
game Phaser.Game

A reference to the currently running game.

x number <optional>
0

The x coordinate of the Image. The coordinate is relative to any parent container this Image may be in.

y number <optional>
0

The y coordinate of the Image. The coordinate is relative to any parent container this Image may be in.

key string | Phaser.RenderTexture | Phaser.BitmapData | PIXI.Texture <optional>

The texture used by the Image during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture, BitmapData or PIXI.Texture.

frame string | number <optional>

If this Image is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.

Source code: gameobjects/Image.js (Line 36)
doc_phaser
2017-02-14 10:52:18
Comments
Leave a Comment

Please login to continue.