Jump to content

text.anchor.set(0.5) removes text


Miniversal
 Share

Recommended Posts

I have a very simple bit of code the places the word "START" at the (almost) center of the screen. However, when I try to set the text's anchor to its own relative center, the text vanishes from the game with no error. Am I doing something wrong?

copyRight = ' START ';startText = this.add.text(this.world.centerX, this.world.centerY, copyRight);//startText.anchor.set(0.5); //<- Commenting out this line I see text, when the line is not commented, the text vanishes???startText.font = 'Impact';startText.fontSize = 48;startText.fontWeight = '600';startText.stroke = '#0066ff';startText.align = 'center';startText.strokeThickness = '5';startText.fill = '#00ff00';

I was trying to follow the example here: http://phaser.io/examples/v2/text/hello-arial

 

 

Link to comment
Share on other sites

Okay, I believe I have discovered a bug?

 

It seems that it's an incompatibility between setting the anchor point of the text and adding a stroke to it, specifically setting the thickness. If I comment out line 44 and uncomment line 37, the text appears at the expected location on screen.

 

At any rate, I guess I'll switch to using a bitmap font to achieve the stroke look that I wanted. :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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