Jump to content

BitmapText incorrect mapping on UHD/retina screens


Metafaux
 Share

Recommended Posts

I am updating a web game from Pixi 3 to Pixi 4, and upon doing so, all the BitmapText broke on ultra-high definition screens (e.g. retina displays, MacBook, Surface Pro). The text looks completely normal on regular HD/1080 displays.

The fonts are created through BMFont, set to export XML & PNG. In the game, when a UHD screen resolution is detected, it loads a larger bitmap file (e.g. Roboto48.fnt instead of Roboto24.fnt). After loading, BitmapText elements are instantiated like this:

var scoreText = new PIXI.extras.BitmapText("Score: 0", {font: "24px Roboto"});

When I run the game with Pixi 3, the text looks fine again.

I can't find any other examples of this or support questions dealing with this problem. Has anyone encountered this or found a fix?

BitmapTextUHD.PNG

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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