Jump to content

How to measure PIXI.Text height while using cocoonjs?


trueicecold
 Share

Recommended Posts

Hey all

 

I've encountered a bug making the measurement of text dimensions impossible while using canvas+ on cocoonjs. I've read (and saw the source code) that height dimension is using html DOM element to measure it, and that a different approach is needed. Question is - what approach? is there a better way of measuring Text height?

 

Right now I'm using the same font size I put in the PIXI.Text properties as height...

 

Thanks! :)

Link to comment
Share on other sites

  • 3 months later...

I know it's old, but all of my searches shows posts left unanswered: Is there a fix to this? I'm using pixijs 1.6.1 and the text height in cocoonjs shows the entire screen height...

I know I should calculate it myself, but how exactly? Is there a formula for this? I know I can use the font size for this, but it's not science, since sometimes I have to multiply it by 1.1 or 1.2, depend on the font size, to get it aligned correctly...

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