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.


Sign In
Create Account

Back to top









