Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

271
Views
Bold a specific word in a sentence in quotation marks in visual studio code

so I was tasked to create a game in visual studio code using phaser.io for help. At the moment, I was told to bold a specific word in a sentence that is in quotation marks, but I am not sure how to do show. This is all in a Javascript file.

const text3 = this.add.text(
  650,
  460,
  "Answer: Have a budget plan to save up money to buy it.",
  { fontFamily: "Roboto", fill: "black" }
);

I am suppose to bold the word "Answer" that is in quotation marks, so it should look like such

const text3 = this.add.text(
  650,
  460,
  "**Answer**: Have a budget plan to save up money to buy it.",
  { fontFamily: "Roboto", fill: "black" }
);

Can someone help me out with this?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Try this

const text3 = this.add.text(
  650,
  460,
  "Answer: Have a budget plan to save up money to buy it.",
  { fontFamily: "Roboto", fill: "black" }
);

text3.addFontWeight('bold', 0); // 0 means the start of the text
text3.addFontWeight('normal', 6); // change it to normal starting from index 6 of the text

See: Documentation

about 4 years ago · Juan Pablo Isaza Report

0

Phaser 3

Inline styling of text is no supported natively, as per this github issue.

It's worth mention rexBBCodeText & rexTagText that could help you to manage inline style in a better way (using BBCode or html tags).

In any case, if you really need to use this syntax **Answer**, it's better to split the string and manage each part alone.

Phaser 2 CE

This old version manage text in a different way and you could use addFontWeight specifying the beginning inside the string of the change in weight.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!