Miniversal Posted May 27, 2015 Share Posted May 27, 2015 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 More sharing options...
Miniversal Posted May 27, 2015 Author Share Posted May 27, 2015 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 More sharing options...
Miniversal Posted May 28, 2015 Author Share Posted May 28, 2015 This was just a syntax error. strokeThickness = 5; NOT strokeThickness = '5'; Link to comment Share on other sites More sharing options...
Recommended Posts