Jump to content

Phaser 3 setTextBounds equivalent


Bike
 Share

Recommended Posts

	var rect = new Phaser.Geom.Rectangle(0, 440, 800, 160);
    var graphics = this.add.graphics({ fillStyle: { color: 0x0000ff } });
    graphics.fillRectShape(rect);


     var style = { 
            fontSize: 24,
            fontFamily: 'Arial',
            align: "center"
        }
	
	prize_text = this.add.text(300,525, "text", style);
	prize_text.setTextBounds(0,440,800,160);

New to Phaser 3 and I am trying to create a boundary to center text within but setTextBounds doesn't appear to be working. (Errors that it isn't a function) 

Is this a Phaser 2 thing? Is there an equivalent in Phaser 3?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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