void OnGUI()
 {
     if (roamingCursor.activeInHierarchy)
     {
         GUIExtended.Label(new Rect((Screen.width - 100) / 2, Screen.height * 0.75f, 100, 100), "Choose Location", new GUIStyle(GUI.skin.label), Color.black, Color.white);
     }
 }
    void OnGUI()
    {
        GUIStyle style = new GUIStyle(skin.label);

        style.font      = skin.font;
        style.fontSize  = 22;
        style.alignment = TextAnchor.UpperRight;

        string title = mode == 0 ? "Your Scores" : "Top Scores";

        GUI.BeginGroup(new Rect(Screen.width - 210, 10, 200, 300));

        GUIExtended.Label(new Rect(0, 0, 200, 50), title, style, Color.black, Color.white);

        if (mode == 0)
        {
            ShowYourScores();
        }
        else
        {
            ShowTopScores();
        }

        GUI.EndGroup();
    }
    void OnGUI()
    {
        GUIStyle style = new GUIStyle(skin.label);

        style.font     = skin.font;
        style.fontSize = 18;

        GUIExtended.Label(new Rect(130, 10, 200, 50), playerList.Count + " Player(s) Online", style, Color.black, Color.white);
    }
Example #4
0
    void OnGUI()
    {
        GUI.BeginGroup(new Rect(Screen.width - 150 - 20, 10, 150, 70), GUI.skin.box);

        GUIStyle style = new GUIStyle(skin.label);

        style.font      = skin.font;
        style.fontSize  = 20;
        style.alignment = TextAnchor.UpperRight;

        GUIExtended.Label(new Rect(-10, 10, 150, 50), credits.ToString("n0") + " Credits", style, Color.black, Color.green);

        style           = new GUIStyle(skin.label);
        style.font      = skin.font;
        style.fontSize  = 20;
        style.alignment = TextAnchor.UpperRight;

        GUIExtended.Label(new Rect(-10, 30, 150, 50), coins.ToString("n0") + " Coins", style, Color.black, Color.yellow);

        GUI.EndGroup();

        if (GUI.Button(new Rect(Screen.width - 170, 90, 150, 30), "Top 3 players"))
        {
            showTopListDialog = true;
        }

        if (showTopListDialog)
        {
            GUI.BeginGroup(new Rect(Screen.width / 2 - 150, Screen.height / 2 - 100, 300, 200), GUI.skin.box);

            style.font      = skin.font;
            style.fontSize  = 20;
            style.alignment = TextAnchor.UpperCenter;

            GUIExtended.Label(new Rect(20, 10, 250, 50), " Top players ranking", style, Color.black, Color.white);

            style.fontSize  = 15;
            style.alignment = TextAnchor.UpperCenter;

            getTopPlayers();

            GUIExtended.Label(new Rect(10, 50, 250, 50), topPlayerNames[0] + "\t" + topPlayerScores[0], style, Color.black, Color.white);
            GUIExtended.Label(new Rect(10, 100, 250, 50), topPlayerNames[1] + "\t" + topPlayerScores[1], style, Color.black, Color.white);
            GUIExtended.Label(new Rect(10, 150, 250, 50), topPlayerNames[2] + "\t" + topPlayerScores[2], style, Color.black, Color.white);

            GUI.EndGroup();
        }

        if (Input.GetKeyDown("return") || Input.GetMouseButtonDown(0))
        {
            showTopListDialog = false;
        }
    }
Example #5
0
    void OnGUI()
    {
        GUIStyle style = new GUIStyle(skin.label);

        style.font      = skin.font;
        style.fontSize  = 20;
        style.alignment = TextAnchor.UpperCenter;

        GUI.BeginGroup(new Rect(Screen.width / 2 - 75, 10, 150, 150));
        GUIExtended.Label(new Rect(0, 0, 150, 50), DateTimeFormatInfo.CurrentInfo.GetMonthName(month), style, Color.black, Color.white);
        GUIExtended.Label(new Rect(0, 25, 150, 50), "Day " + day, style, Color.black, Color.white);
        GUI.EndGroup();
    }
Example #6
0
	void OnGUI() {
				if (!isBeHidden) {
						height = PlayerList.Count * 20;
						GUIStyle style = new GUIStyle(skin.label);
						style.font = skin.font;
						style.fontSize = 18;
						style.alignment = TextAnchor.UpperLeft;
						Color32 color = new Color32();;

						windowRect = new Rect(25, 10, 150, 200);
						if (GUI.Button(new Rect(25, 210, 50, 30), "Close")) {
							mainObject.GetComponent<PlayerList>().Show();
							Destroy(this);
						}
				Color temp = GUI.color;
				GUI.Box(new Rect(25, 10, 150, 200), "Player List");
				scrollPosition = GUI.BeginScrollView(new Rect(25, 30, 150, 175), scrollPosition, new Rect(25, 30, 130, height));;
				for (int i = 1; i <= PlayerList.Count; i++) {
					
					GUI.BeginGroup (new Rect (27, 22 + (i - 1) * 20, 150, 200));
					var boxStyle = new GUIStyle(GUI.skin.box);
//					if (PlayerList[i].color != 0)
//					{
//						color = PlayerColorList[PlayerList[i].color];
//					}
//					else
//					{
//						color = Color.gray;
//					}
					GUIExtended.Label(new Rect(4, 0, 100, 100), PlayerList[i].name, style, Color.white, color);
					GUI.color = new Color(1.0f,1.0f,1.0f,0.0f);
					if (GUI.Button(new Rect(0, 4, 100, 20), ""))
					{
						var ownerid = PlayerList[i].GetID();
						var ownedtile = map.FindPlayerOwnedTile(ownerid);
						if (ownedtile != null)
						{
							var x = ownedtile.transform.position.x;
							var y = GameObject.Find("MapCamera").transform.position.y;
							var z = ownedtile.transform.position.z - 40;
							Vector3 pos = new Vector3(x, y, z);
							GameObject.Find("MapCamera").transform.position = pos;
						}
					}
					GUI.EndGroup ();
				GUI.color = temp;
				}
				GUI.EndScrollView();
				}	  
		}
    public void ShowTopScores()
    {
        GUIStyle style = new GUIStyle(skin.label);

        style.font      = skin.font;
        style.fontSize  = 20;
        style.alignment = TextAnchor.UpperRight;

        GUIStyle scoreStyle = new GUIStyle(skin.label);

        scoreStyle.font      = skin.font;
        scoreStyle.fontSize  = 18;
        scoreStyle.alignment = TextAnchor.UpperRight;

        {
            Rect rect = new Rect(0, 30, 200, 50);
            GUIExtended.Label(rect, "High Score", style, Color.black, new Color(1.0f, 0.93f, 0.73f, 1.0f));

            for (int i = 0; i < highScoreList.Length; i++)
            {
                string scoreText = highScoreList[i] == 0 ? "-" : highScoreList[i].ToString("n0");
                GUIExtended.Label(new Rect(rect.x, rect.y + 20 + i * 20, 200, 50), scoreText, scoreStyle, Color.black, Color.white);
            }
        }

        {
            Rect rect = new Rect(0, 120, 200, 50);
            GUIExtended.Label(rect, "Total Score", style, Color.black, new Color(1.0f, 0.93f, 0.73f, 1.0f));

            for (int i = 0; i < totalScoreList.Length; i++)
            {
                string scoreText = totalScoreList[i] == 0 ? "-" : totalScoreList[i].ToString("n0");
                GUIExtended.Label(new Rect(rect.x, rect.y + 20 + i * 20, 200, 50), scoreText, scoreStyle, Color.black, Color.white);
            }
        }

        {
            Rect rect = new Rect(0, 200, 200, 50);
            GUIExtended.Label(rect, "Current Score", style, Color.black, new Color(1.0f, 0.93f, 0.73f, 1.0f));

            for (int i = 0; i < currentScoreList.Length; i++)
            {
                string scoreText = currentScoreList[i] == 0 ? "-" : currentScoreList[i].ToString("n0");
                GUIExtended.Label(new Rect(rect.x, rect.y + 20 + i * 20, 200, 50), scoreText, scoreStyle, Color.black, Color.white);
            }
        }
    }
Example #8
0
    void OnGUI()
    {
        //GUI.Label (new Rect(300, 0, 200, 50), "Environment Score: " + score );
        GUI.BeginGroup(new Rect(Screen.width / 2 - 100, 60, 200, 100));
        GUIStyle style = new GUIStyle();

        style.font      = skin.font;
        style.fontSize  = 20;
        style.alignment = TextAnchor.UpperCenter;

        Color color = new Color(1.0f, 0.93f, 0.73f, 1.0f);

        GUIExtended.Label(new Rect(0, 0, 200, 50), "Ecosystem Score", style, Color.black, color);

        style.fontSize  = 24;
        style.alignment = TextAnchor.UpperCenter;

        GUIExtended.Label(new Rect(0, 25, 200, 50), score.ToString("n0"), style, Color.black, Color.white);
        GUI.EndGroup();
    }
Example #9
0
    void OnGUI()
    {
        GUI.BeginGroup(new Rect(Screen.width - 150 - 20, 10, 150, 70), GUI.skin.box);

        GUIStyle style = new GUIStyle(skin.label);

        style.font      = skin.font;
        style.fontSize  = 20;
        style.alignment = TextAnchor.UpperRight;

        GUIExtended.Label(new Rect(-10, 10, 150, 50), credits.ToString("n0") + " Credits", style, Color.black, Color.green);

        style           = new GUIStyle(skin.label);
        style.font      = skin.font;
        style.fontSize  = 20;
        style.alignment = TextAnchor.UpperRight;

        GUIExtended.Label(new Rect(-10, 30, 150, 50), coins.ToString("n0") + " Coins", style, Color.black, Color.yellow);

        GUI.EndGroup();
    }