GameObjectFactory#tileSprite()

tileSprite(x, y, width, height, key, frame, group) → {Phaser.TileSprite}

Creates a new TileSprite object.

Parameters
Name Type Argument Description
x number

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

y number

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

width number

The width of the TileSprite.

height number

The height of the TileSprite.

key string | Phaser.BitmapData | PIXI.Texture

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

frame string | number <optional>

If a Texture Atlas or Sprite Sheet is used this allows you to specify the frame to be used. Use either an integer for a Frame ID or a string for a frame name.

group Phaser.Group <optional>

Optional Group to add the object to. If not specified it will be added to the World group.

Returns

The newly created TileSprite object.

Source code: gameobjects/GameObjectFactory.js (Line 275)
doc_phaser
2017-02-14 10:48:49
Comments
Leave a Comment

Please login to continue.