RetardVeverca Posted March 26, 2014 Share Posted March 26, 2014 Hi! I have a problem of centering BitmapText after it has been updated with setText method and it's dimension changed. Does someone know how to do it? I have my text defined as:this.score = new game.BitmapText('0', {font: 'soupjustice64w'});this.score.position.x = game.system.width/2;this.score.position.y = game.system.height/2;game.scene.stage.addChild(this.score);And then I update it and want to set new position:this.score.setText('300');this.score.position.x = (game.system.width/2)-(this.score.textWidth/2);this.score.position.y = game.system.height/2;But this doesnt work :/ Quote Link to comment Share on other sites More sharing options...
enpu Posted March 26, 2014 Share Posted March 26, 2014 That's bug on Pixi, you should call updateTransform after changing text:this.score.setText('300');this.score.updateTransform();this.score.position.x = (game.system.width/2)-(this.score.textWidth/2);this.score.position.y = game.system.height/2; Quote Link to comment Share on other sites More sharing options...
RetardVeverca Posted March 26, 2014 Author Share Posted March 26, 2014 Wow, fast answer, thank you so much! Panda.JS is great, it really allows rapid development and it works so fast even on older androids Quote Link to comment Share on other sites More sharing options...
enpu Posted March 26, 2014 Share Posted March 26, 2014 That's nice to hear! 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.