Jump to content

[Firefox] Wrong text border


user471
 Share

Recommended Posts

This code

    var text = game.add.text(10, 10, "12345", style)
    var graphics = game.add.graphics(0,0)
    graphics.lineStyle(1, white,1)
    graphics.drawRect(text.x, text.y, text.width, text.height)

 

create this

 

rOHzsIX.png

 

Is there any way I can fix it? Firefox 29.

Link to comment
Share on other sites

This may be down to default style settings. Try something like normalize.css in your HTML, see if that fixes it. It may not however, as the creation of the text may be done outside of the scope of the stylesheet's influence. If this is the case, I'm afraid there may be no alternative other than browser sniffing and adjusting for any discrepancies, or using BitmapText which should look the same in all browsers as it does not rely on any browser-specific font rendering functionality.

Link to comment
Share on other sites

  • 3 months later...
 Share

  • Recently Browsing   0 members

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