I’m trying to add lines of texts, optional suggestions for a game.
More specifically, Spades. However, I’m having slight trouble with this. I can’t see how to add lines of text, or check boxes to a box in GUI.box. Here’s what I have so far:
public class CameraGUI : MonoBehaviour {
private int menuSelection = -1;
private string[] button=new string[] {
"Single Player",
"Multi Player",
"Leaderboards"};
public GUISkin mainSkin;
static int startB=25;
static int buttonW=425;
static int buttonH=275;
private int windowW=500;
private int windowH=600;
private int screenW=Screen.width;
void OnGUI() {
GUI.skin=mainSkin;
menuSelection=GUI.SelectionGrid(new Rect(startB,startB,buttonW,buttonH), menuSelection, button, 1);
switch(menuSelection) {
case 0:
SPOptionsWindow();
break;
case 1:
MPOptionsWindow();
break;
case 2:
LeaderboardsWindow();
break;
default:
//error handling here....
break;
}
}
void SPOptionsWindow() {
GUI.Box(new Rect(screenW*.5f,Screen.height*(.25f/10.0f),windowW,windowH), "Single Player Pre-Start Options");
}
void MPOptionsWindow() {
GUI.Box(new Rect(screenW*.5f,Screen.height*(.25f/10.0f),windowW,windowH), "Multi Player Pre-Start Options");
}
void LeaderboardsWindow() {
GUI.Box(new Rect(screenW*.5f,Screen.height*(.25f/10.0f),windowW,windowH), "Leaderboards");
}
}