Skip to content

Commit 7dd63df

Browse files
committed
Merge pull request phaserjs#52 from cocoademon/master
Make Phaser.Text play nicely with scrolling, by using an explicit x, y
2 parents c5fc5e3 + 6fde862 commit 7dd63df

2 files changed

Lines changed: 3 additions & 26 deletions

File tree

src/gameobjects/RenderTexture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Phaser.RenderTexture = function (game, key, width, height) {
99
this.width = width || 100;
1010
this.height = height || 100;
1111

12-
this.indetityMatrix = PIXI.mat3.create();
12+
this.identityMatrix = PIXI.mat3.create();
1313

1414
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
1515

src/gameobjects/Text.js

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Phaser.Text = function (game, x, y, text, style) {
2121

2222
this.type = Phaser.TEXT;
2323

24-
this.position.x = x;
25-
this.position.y = y;
24+
this.position.x = this.x = x;
25+
this.position.y = this.y = y;
2626

2727
// Replaces the PIXI.Point with a slightly more flexible one
2828
this.anchor = new Phaser.Point();
@@ -91,26 +91,3 @@ Object.defineProperty(Phaser.Text.prototype, 'angle', {
9191

9292
});
9393

94-
Object.defineProperty(Phaser.Text.prototype, 'x', {
95-
96-
get: function() {
97-
return this.position.x;
98-
},
99-
100-
set: function(value) {
101-
this.position.x = value;
102-
}
103-
104-
});
105-
106-
Object.defineProperty(Phaser.Text.prototype, 'y', {
107-
108-
get: function() {
109-
return this.position.y;
110-
},
111-
112-
set: function(value) {
113-
this.position.y = value;
114-
}
115-
116-
});

0 commit comments

Comments
 (0)