lars Posted January 16, 2020 Share Posted January 16, 2020 Hey 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. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 16, 2020 Share Posted January 16, 2020 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. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 16, 2020 Share Posted January 16, 2020 Solution can also appear in one of pulls: https://github.com/pixijs/pixi.js/pulls?utf8=✓&q=is%3Apr+BitmapText Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.