mirror of
https://github.com/wassname/phaser.git
synced 2026-08-14 12:40:17 +08:00
Text converted and a couple of examples created. Using new extend system, so much smaller classes now.
This commit is contained in:
@@ -8,25 +8,10 @@ Phaser.TileSprite = function (game, x, y, width, height, key, frame) {
|
||||
frame = frame || null;
|
||||
|
||||
Phaser.Sprite.call(this, game, x, y, key, frame);
|
||||
PIXI.TilingSprite.call(this);
|
||||
|
||||
this.texture = PIXI.TextureCache[key];
|
||||
|
||||
/**
|
||||
* The width of the tiling sprite
|
||||
*
|
||||
* @property width
|
||||
* @type Number
|
||||
*/
|
||||
this.width = width;
|
||||
|
||||
/**
|
||||
* The height of the tiling sprite
|
||||
*
|
||||
* @property height
|
||||
* @type Number
|
||||
*/
|
||||
this.height = height;
|
||||
PIXI.TilingSprite.call(this, this.texture, width, height);
|
||||
|
||||
/**
|
||||
* The scaling of the image that is being tiled
|
||||
@@ -34,7 +19,7 @@ Phaser.TileSprite = function (game, x, y, width, height, key, frame) {
|
||||
* @property tileScale
|
||||
* @type Point
|
||||
*/
|
||||
this.tileScale = new Phaser.Point(1,1);
|
||||
this.tileScale = new Phaser.Point(1, 1);
|
||||
|
||||
/**
|
||||
* The offset position of the image that is being tiled
|
||||
@@ -42,11 +27,10 @@ Phaser.TileSprite = function (game, x, y, width, height, key, frame) {
|
||||
* @property tilePosition
|
||||
* @type Point
|
||||
*/
|
||||
this.tilePosition = new Phaser.Point(0,0);
|
||||
this.tilePosition = new Phaser.Point(0, 0);
|
||||
|
||||
};
|
||||
|
||||
// Extend Phaser.Sprite and PIXI.TilingSprite
|
||||
Phaser.TileSprite.prototype = Phaser.Utils.extend(true, PIXI.TilingSprite.prototype, Phaser.Sprite.prototype);
|
||||
Phaser.TileSprite.prototype.constructor = Phaser.TileSprite;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user