Tymski Posted April 30, 2017 Share Posted April 30, 2017 How can I make my text more consistent and better looking? Insi 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 28, 2017 Share Posted July 28, 2017 You use anchor.x = 0.5, right? I use custom rounding for sprite coords often. Something like that might work: PIXI.Sprite.prototype.centerXY = function() { var orig = this._texture._orig; this.anchor.x = (orig.width >> 1) / orig.width; this.anchor.y = (orig.height >> 1) / orig.height; } function centerXYOnUpdate() { PIXI.Sprite.prototype._onTextureUpdate.call(this); this.centerXY(); } // when i want to center whole text by XY text.centerXY(); // add automatic handler when i change the text text.onTextureUpdate = centerXYOnUpdate; Please note that I just wrote this from scratch and I dont know if it works, you have to debug it. I dont want to explain it further. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.