Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

273
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda