Sign in to follow this  
alr92

Translate Phaser 2 "addChild" to Phaser 3

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.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.