Jump to content

Phaser not load bitmap font?


rossi46
 Share

Recommended Posts

I use http://kvazars.com/littera/ to create bit map font. But when i use, it not run???

Here is the link demo. http://font.mauxanh.vn

My code load font:

this.load.bitmapFont("Prophit", Config.BASE_URL + "fonts/V5ProphitDot.png", Config.BASE_URL + "fonts/V5ProphitDot.xml");
        this.load.bitmapFont("Roboto", Config.BASE_URL + "fonts/Roboto.png", Config.BASE_URL + "fonts/Roboto.xml");
        this.load.bitmapFont("RobotoBold", Config.BASE_URL + "fonts/RobotoBold.png", Config.BASE_URL + "fonts/RobotoBold.xml");

 

Code use font: 

this.textBalance = this.add.text(36, 12, "10", { font: "17px 'Roboto'", fill: "#fff", align: "center" });
this.textJackpot = this.add.text(this.world.centerX, 24, "0", { font: "42px 'Prophit'", fill: "#fff600", align: "center" });
this.textBalance = this.add.text(270, 8, "#0", { font: "17px 'Roboto'", fill: "#fff", align: "center" });

But it not load bitmapfont. it is "time new roman" font??? Help me?

Link to comment
Share on other sites

1 hour ago, rossi46 said:

I use http://kvazars.com/littera/ to create bit map font. But when i use, it not run???

Here is the link demo. http://font.mauxanh.vn

My code load font:


this.load.bitmapFont("Prophit", Config.BASE_URL + "fonts/V5ProphitDot.png", Config.BASE_URL + "fonts/V5ProphitDot.xml");
        this.load.bitmapFont("Roboto", Config.BASE_URL + "fonts/Roboto.png", Config.BASE_URL + "fonts/Roboto.xml");
        this.load.bitmapFont("RobotoBold", Config.BASE_URL + "fonts/RobotoBold.png", Config.BASE_URL + "fonts/RobotoBold.xml");

 

Code use font: 


this.textBalance = this.add.text(36, 12, "10", { font: "17px 'Roboto'", fill: "#fff", align: "center" });
this.textJackpot = this.add.text(this.world.centerX, 24, "0", { font: "42px 'Prophit'", fill: "#fff600", align: "center" });
this.textBalance = this.add.text(270, 8, "#0", { font: "17px 'Roboto'", fill: "#fff", align: "center" });

But it not load bitmapfont. it is "time new roman" font??? Help me?

Sorry I use bitmapText, it ok. How to tint bitmapText. Example I want bit map text color is white or yellow, i set: 

this.textJackpot.tint = 0xfff600;
this.textBalance.tint = 0xffffff;

 

It tint color to black????

 

How to set color of bitmaptext

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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