Jump to content

Superscript in Phaser.Text object


Lkuich
 Share

Recommended Posts

Hi, I am trying to format a specific part of a Phaser.Text object as a superscript. I am using TypeScript in the project.

 

 

For example:

var question: Phaser.Text = this.add.text(0, 0, "3x2", { font: "24px Arial", fill: "#000", align: "center" });

Looks like:

3x2

 

 

But I want it to look like:

3x2

 

Unfortunately String.prototype.sup() is depreciated.

 

How would I get this result? I know I can use the <sup> tag, but am not sure how to use this in a Phaser.Text object.

 

Thank you.

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 years later...
 Share

  • Recently Browsing   0 members

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