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

279
Views
Ponga en negrita una palabra específica en una oración entre comillas en el código de Visual Studio

así que me encargaron crear un juego en código de Visual Studio usando Phaser.io como ayuda. En este momento, me dijeron que pusiera en negrita una palabra específica en una oración que está entre comillas, pero no estoy seguro de cómo hacerlo. Todo esto está en un archivo Javascript.

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

Se supone que debo poner en negrita la palabra "Respuesta" que está entre comillas, por lo que debería verse así

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

¿Alguien me puede ayudar con esto?

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

0

Prueba esto

 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

Ver: Documentación

about 4 years ago · Juan Pablo Isaza Report

0

Fáser 3

El estilo de texto en línea no se admite de forma nativa, según este problema de github .

Vale la pena mencionar rexBBCodeText y rexTagText que podrían ayudarlo a administrar el estilo en línea de una mejor manera (usando BBCode o etiquetas html).

En cualquier caso, si realmente necesita usar esta sintaxis **Answer** , es mejor dividir la cadena y administrar cada parte por separado.

Phaser 2 CE

Esta versión anterior administra el texto de una manera diferente y puede usar addFontWeight especificando el comienzo dentro de la cadena del cambio de peso.

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!