Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Text not fully displaying (Solved)

Discussion in 'Scripting' started by spudshroom, Jun 24, 2016.

  1. spudshroom

    spudshroom

    Joined:
    Jun 24, 2016
    Posts:
    2
    int percent = Cscore*100 / 9;
    Score.text = "Count: "+Cscore.ToString ()+"/9\t"+percent.ToString ()+"%Completion";

    Ingame it displays without the "%Completion" part.
    Could it be that along with "\" "%" is an operator in a string?
    If so, how could I escape and display it as a normal "%"?

    Thanks.
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,903
    Usually backslash is for escaping characters, "\%Completion"
    or maybe try two "%%Completion"

    Or maybe \t tab causes it to go too far (cannot fit in the text?)
     
  3. spudshroom

    spudshroom

    Joined:
    Jun 24, 2016
    Posts:
    2
    Figured out what was going wrong. Made me feel dumb. Turns out the text area was not wide enough.