Jump to content

RetroFont from image slice


pistacchio
 Share

Recommended Posts

Hi,
I can create a retroFont like this and it works.
 
this.load.image('textfont', 'static/img/textfont.png');[...]var font = this.add.retroFont('textfont', 6, 5, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789');font.text = 'TOP SCORE 76';this.add.image(20, 50, font);

If i bundle the font image into a bigger one and try to create the retroFont by cutting it out of the bigger image, the creation doesn't rise any error, but any attempt to do anything with the font (like font.text = '123') rises any kind of error:

this.load.image('images', 'static/img/images.png');[...]var font = this.add.retroFont('yellow-retro-font', 6, 5, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789');font.text = 'TOP SCORE';this.add.image(100, 100, font);

Any idea?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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