i3Designer Posted November 20, 2014 Share Posted November 20, 2014 I created a text, I used a custom font with font-face @font-face { font-family: "blopF"; src: url('assets/font/blop.ttf') format("truetype"), url('assets/font/blop.woff') format('woff'), url('assets/font/blop.eot') format('embedded-opentype'); } js:this.tempo = game.add.text(game.world.centerX,game.world.centerY,game.global.tempo,{fill:'#000',font:'150px blopF'});this.tempo.alpha = 0.2;this.tempo.anchor.x = 0.5;this.tempo.anchor.y = 0.5; update: this.tempo.text = game.global.tempo; Problem: The problem is that the text is cut (show image)I would like to solve this problem, I tried to do:this.tempo.text = "" + game.global.tempo + ""; But the font does not work Link to comment Share on other sites More sharing options...
stupot Posted November 21, 2014 Share Posted November 21, 2014 i3D, more info is needed for anyone to try and help: - version of phaser, which file variant you use- version of browser/OS- post the font file I've had problems with font shadows getting chopped in the same way, to get around it I used wordWrap = true and set a suitable value for wordWrapWidth. Link to comment Share on other sites More sharing options...
pumuky Posted November 25, 2014 Share Posted November 25, 2014 I've had the same Stupot's problems... I think that it's not the best solution but, try to add spaces at the begining and at the end:this.tempo.text = " " + game.global.tempo + " "; Link to comment Share on other sites More sharing options...
Recommended Posts