playMaker

Author Topic: Set Text Mesh Pro String text advanced question  (Read 586 times)

Evaldas

  • Playmaker Newbie
  • *
  • Posts: 21
Set Text Mesh Pro String text advanced question
« on: January 29, 2022, 01:53:34 PM »
Hello! Maybe somebody can help me with formatting Text Mesh Pro UGUI text:
   - I get get string value from an object (gun reload speed)
   - I set text mesh pro text to that string value

How can I format the text on Text Mesh Pro object so that it would display extra text by the end of the line, for example: "[string value] seconds"

I know I have seen how to format it like that somewhere, but spent an hour searching with no results :/

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Set Text Mesh Pro String text advanced question
« Reply #1 on: January 29, 2022, 04:22:28 PM »
Hi.
You can use 'Build String' :)

getting string name from an object might not be the best way, if you want to support multiple languages for your game.

Evaldas

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Set Text Mesh Pro String text advanced question
« Reply #2 on: January 30, 2022, 07:08:29 AM »
Nice, 'Build String' does what I needed!

Haven't thought how to approach multiple languages to be honest, thank you, I will look into it :)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Set Text Mesh Pro String text advanced question
« Reply #3 on: January 30, 2022, 10:01:36 AM »
Hi.
For this you can get some asset like I2 Localization or Localization (Multi-Language)
Both samples have Playmaker actions (Search for 'localization playmaker' on the asset store)
or
Build your own system.
With arrays or scriptable objects (for this you need to have a little bit knowledge of coding)