mirror of
https://github.com/wassname/phaser.git
synced 2026-08-20 12:40:12 +08:00
Make Phaser.Text play nicely with scrolling, by using an explicit x, y
This commit is contained in:
+2
-25
@@ -21,8 +21,8 @@ Phaser.Text = function (game, x, y, text, style) {
|
|||||||
|
|
||||||
this.type = Phaser.TEXT;
|
this.type = Phaser.TEXT;
|
||||||
|
|
||||||
this.position.x = x;
|
this.position.x = this.x = x;
|
||||||
this.position.y = y;
|
this.position.y = this.y = y;
|
||||||
|
|
||||||
// Replaces the PIXI.Point with a slightly more flexible one
|
// Replaces the PIXI.Point with a slightly more flexible one
|
||||||
this.anchor = new Phaser.Point();
|
this.anchor = new Phaser.Point();
|
||||||
@@ -91,26 +91,3 @@ Object.defineProperty(Phaser.Text.prototype, 'angle', {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.defineProperty(Phaser.Text.prototype, 'x', {
|
|
||||||
|
|
||||||
get: function() {
|
|
||||||
return this.position.x;
|
|
||||||
},
|
|
||||||
|
|
||||||
set: function(value) {
|
|
||||||
this.position.x = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
Object.defineProperty(Phaser.Text.prototype, 'y', {
|
|
||||||
|
|
||||||
get: function() {
|
|
||||||
return this.position.y;
|
|
||||||
},
|
|
||||||
|
|
||||||
set: function(value) {
|
|
||||||
this.position.y = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|||||||
Reference in New Issue
Block a user