Jump to content

Why so? BitmapText.


instantia
 Share

Recommended Posts

Strangely shows the text

doubled pixels:

3rs3ao4l2q.jpg

 

 

fragment code .fnt:

 

    <char id="49" x="192" y="2" width="2" height="7" xoffset="0" yoffset="1" xadvance="4" page="0" chnl="15" letter="1"/>    <char id="50" x="197" y="2" width="5" height="7" xoffset="0" yoffset="1" xadvance="7" page="0" chnl="15" letter="2"/>    <char id="51" x="204" y="2" width="5" height="7" xoffset="0" yoffset="1" xadvance="7" page="0" chnl="15" letter="3"/>    <char id="52" x="211" y="2" width="5" height="7" xoffset="0" yoffset="1" xadvance="7" page="0" chnl="15" letter="4"/>    <char id="53" x="218" y="2" width="5" height="7" xoffset="0" yoffset="1" xadvance="7" page="0" chnl="15" letter="5"/>    <char id="54" x="225" y="2" width="5" height="7" xoffset="0" yoffset="1" xadvance="7" page="0" chnl="15" letter="6"/>    <char id="55" x="232" y="2" width="5" height="7" xoffset="0" yoffset="1" xadvance="7" page="0" chnl="15" letter="7"/>    <char id="56" x="239" y="2" width="5" height="7" xoffset="0" yoffset="1" xadvance="7" page="0" chnl="15" letter="8"/>    <char id="57" x="246" y="2" width="5" height="7" xoffset="0" yoffset="1" xadvance="7" page="0" chnl="15" letter="9"/>

font .png

zmfcrwz4dl.png


Why is there such a shift?

 

Name: new PIXI.BitmapText(mName, {font: "17px nbp", align: "center"}),
Name.position.x = roundHalf(x - Name.textWidth / 2);Name.position.y = roundHalf(y - Name.textHeight / 2);

roundHalf© = (c << 0) - 0.5;

Why is this split pixels?

 

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