Jump to content

BitmapText anchor y is inaccurate


Herbert
 Share

Recommended Posts

What tool did you use for your font?

Open your .fnt or .xml file.

Make sure that lineHeight is equal to size.

Example:

<info face="Font" size="64" bold="0" italic="0" charset="" unicode="" stretchH="100" smooth="1" aa="1" padding="2,2,2,2" spacing="0,0" outline="0"/>
  <common lineHeight="64" base="55" scaleW="2048" scaleH="512" pages="1" packed="0"/>

 

Link to comment
Share on other sites

lineHeight it is, my lineHeight is not the same as char height before(as shown). So If I want the anchor.y based on char height, I need to make sure lineHeight is set to the same value,
and as @ivan.popelyshev said, be aware of offset.

<font>
  <info face="num_02" size="32" bold="0" italic="0" charset="" unicode="1" stretchH="100" smooth="1" aa="1" padding="0,0,0,0" spacing="1,1" outline="0"/>
  <common lineHeight="32" base="26" scaleW="256" scaleH="256" pages="1" packed="0" alphaChnl="0" redChnl="4" greenChnl="4" blueChnl="4"/>
  <pages>
    <page id="0" file="num_02.png" />
  </pages>
  <chars count="11">
    <char id="48" x="89" y="0" width="40" height="54" xoffset="0" yoffset="0" xadvance="40" page="0" chnl="15" />
    <char id="49" x="130" y="0" width="40" height="54" xoffset="0" yoffset="0" xadvance="40" page="0" chnl="15" />
    <char id="50" x="171" y="0" width="40" height="54" xoffset="0" yoffset="0" xadvance="40" page="0" chnl="15" />
    <char id="51" x="212" y="0" width="40" height="54" xoffset="0" yoffset="0" xadvance="40" page="0" chnl="15" />
    <char id="52" x="0" y="55" width="40" height="54" xoffset="0" yoffset="0" xadvance="40" page="0" chnl="15" />
    <char id="53" x="41" y="55" width="40" height="54" xoffset="0" yoffset="0" xadvance="40" page="0" chnl="15" />
    <char id="54" x="82" y="55" width="40" height="54" xoffset="0" yoffset="0" xadvance="40" page="0" chnl="15" />
    <char id="55" x="123" y="55" width="40" height="54" xoffset="0" yoffset="0" xadvance="40" page="0" chnl="15" />
    <char id="56" x="164" y="55" width="40" height="54" xoffset="0" yoffset="0" xadvance="40" page="0" chnl="15" />
    <char id="57" x="205" y="55" width="40" height="54" xoffset="0" yoffset="0" xadvance="40" page="0" chnl="15" />
  </chars>
</font>

 

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