Jump to content

Translate Phaser 2 "addChild" to Phaser 3


alr92
 Share

Recommended Posts

Hi,

recently i moved from Phaser 2 to Phaser 3 and i started some new project. Here is my problem:

In Phaser 2 its easy to add text to sprite like this:

var sprite = game.add.sprite(...);

        var button_style = {
            font: "27px Verdana",
            fontWeight: "bold",
            align: "center",
            fill: "#000000",
            stroke: '#ffffff',
            strokeThickness: 2
        };
button_text = game.add.text(0, 0, 'blabla', button_style);
sprite.addChild(button_text);

 

After few days i am very tired of searching to get solution on Phaser 3 to add text on sprite.

Can anybody help me please ? Thanks in advance.

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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