Jump to content

Problem with text (pixi)


i3Designer
 Share

Recommended Posts

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

post-7059-0-73202900-1416515893.png

post-7059-0-41827700-1416515894.png

post-7059-0-36323200-1416515896.png

Link to comment
Share on other sites

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...