Jump to content

PIXI.BitmapText and fnt files


Recommended Posts


im trying to find a way to load the png file directly, instead of using the fnt reference: 

<page id='0' file='myfont.png'/>
Is there a way to do something like this:
const bitmapFontText = new PIXI.BitmapText('some text'"myfont.png", { font: '20px myfont', align: 'left' });
or another workaround.
Link to comment
Share on other sites

No idea how to do that. Well, actually lots of ideas but nothing ready :)

You may find something in issues related to BitmapText and its loading: https://github.com/pixijs/pixi.js/issues?utf8=✓&q=is%3Aissue+BitmapText

If there's no such thing, learn the source code of BitmapText and its loader, https://github.com/pixijs/pixi.js/tree/dev/packages/text-bitmap/src , and hack something.

According to https://github.com/pixijs/pixi.js/blob/dev/packages/text-bitmap/src/BitmapFontLoader.js#L139 , if you put your texture in loader with a certain name - it will be loaded instead of the corresponding page of your fnt file.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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