Jump to content

Formatting text (Short Code)

- - - - -

  • Please log in to reply
No replies to this topic

#1
photoScan

photoScan

    Newbie

  • Members
  • Pip
  • 5 posts


    private bool isFive = false;

    private float yPosition = (Screen.width/2)+20;

    public GUIStyle[ ] ReadySlot;

    public string MyArray[ ][ ] = new string[ ] { "a,"b","c","d","e"}, {"f","g","h","i","j"} //..... };



    private void OnGUI() // Method for the purpose of displaying text to the screen.

    {

        DisplaySlots();

    }


    private void DisplaySlots()

    {    


                      if (isFive) 

		    {

			    GUILayout.BeginArea(new Rect((Screen.width/1.5f)+45, yPosition + 150, 180, 500));

		    }

		    else

		    {

			    GUILayout.BeginArea(new Rect((Screen.width/1.5f)+45, yPosition, 180, 500));

		    }

		

		    for (int j = 0; j < 1; j++)

		    {

			    for (int i = 0; i < 5; i++)

			    {

				    if (GUILayout.Button(MyArray[j][i], ReadySlot[i]))

				    {

					    for (int slot = 0; slot < 5; slot++)

					    {

						    if (slot == i) 

						    {

							    ReadySlot[i].normal.textColor = Color.white;

						    }

						    else 

						    {

							    ReadySlot[slot].normal.textColor = Color.black;

						    }

					    }

				    }

			    } // we are done printing 5 here...

		    }

		    GUILayout.EndArea();

    }



Basically, I print the text:
a
b
c
d
e
f
g
h
i
j
k
When I need to be adding a space between columns such as:
a
b
c
d
e

// Space here!

f
g
h
i
j
k

Can't seem to do it...

Edited by photoScan, 24 October 2010 - 07:02 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users