Jump to content

Setting width and height to Phaser.Text behaves strangely?


spinnerbox
 Share

Recommended Posts

I am using this code to create my text field on screen:

screenTypingTextField = gameObject.add.text(200, 520, "", si.Utility.getTextStyleScreenTypingTextGreen());
screenTypingTextField.alpha = 0.5;
screenTypingTextField.anchor.setTo(0.5, 0.5);
//screenTypingTextField.width = 480;
//screenTypingTextField.height = 240;
thisObject.menuObjects.add(screenTypingTextField);
textStyleScreenTypingTextGreen = {
            font :'70pt Arial',
            align : 'center',
            fill: 'Green'
        },

As you can see I have commented the width and height rows.

Its because when i run this code again by entering the same scene that uses this code, it then starts to spread the text over all screen, even bigger.

Is this the right way to create text and then set its width and height?

Or I should just use the font to set text field size?

here is a picture of my typing text field in green spread all over the screen

bug-screen.png.6cb0cc70c1349aeb57374f139bfd16d2.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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