-
Notifications
You must be signed in to change notification settings - Fork 0
/
TitleScreen.cs
87 lines (71 loc) · 2.68 KB
/
TitleScreen.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using UnityEngine;
using System.Collections;
public class TitleScreen : MonoBehaviour
{
public GUISkin customGUISkin;
public bool showHelp = false;
string helpText = "Tak fordi du ville spille Gråt Lys!\n-- Vi er kede af, at man kan gå gennem vægge. Det var simpelthen en uløselig fejl :( --\nDu styrer din karakter ved at klikke med musen på banen.\n Ting du kan snakke med bliver røde når du holder musen over dem.\nVælg de passende valg, og prøv ikke at blive deprimeret over udfaldet... ;)";
string creditsText = "Spillet er lavet af 6 elever på GameIT College:\n\nProjektstyring: Danny Greve\n2D/Tegninger: Rasmus Bjerborg\nProgrammør: Mikkel Ekenberg Thygesen\n3D: Alexander Wedø\nTekst/Dialog/Historie: Allan Hvid Bisgaard\nMusik: Michael Hejlskov";
#region GUI
//Background
public Texture texBackground;
int bgPosX = 0;
int bgPosY = 0;
int bgWidth = 1024;
int bgHeight = 768;
Rect rectBackground;
// play button
public Texture texPlay;
int playPosX = 30;
int playPosY = 550;
Rect rectPlay;
// help
public Texture texHelp;
int helpPosX = 30;
Rect rectHelp;
//Exit
public Texture texExit;
int exitPosX = 30;
//Help box
int hbwidth = Screen.width/5 * 3;
Rect rectHelpBox;
Rect rectCredits;
//spacing int
int spacing = 20;
Rect rectExit;
#endregion
// Use this for initialization
void Start () {
rectPlay = new Rect(playPosX, playPosY, texPlay.width, texPlay.height);
rectHelp = new Rect(helpPosX, playPosY + texPlay.height + spacing, texHelp.width, texHelp.height);
rectExit = new Rect(exitPosX, rectHelp.yMin + texHelp.height + spacing, texExit.width, texExit.height);
rectHelpBox = new Rect(playPosX + rectPlay.width + spacing*2, playPosY, hbwidth/2, rectExit.yMax - playPosY);
rectCredits = new Rect(rectHelpBox.xMax, playPosY, hbwidth / 2, rectExit.yMax - playPosY);
rectBackground = new Rect(bgPosX, bgPosY, bgWidth, bgHeight);
}
void OnGUI()
{
GUI.Box(rectBackground, texBackground, GUIStyle.none);
if (GUI.Button(rectPlay, texPlay, GUIStyle.none))
{
Application.LoadLevel(1);
}
if (GUI.Button(rectHelp, texHelp, GUIStyle.none))
{
if (showHelp == false)
{
showHelp = true;
}
else { showHelp = false; }
}
if (GUI.Button(rectExit, texExit, GUIStyle.none))
{
Application.Quit();
}
if (showHelp)
{
GUI.Box(rectHelpBox, helpText,customGUISkin.box);
GUI.Box(rectCredits, creditsText, customGUISkin.box);
}
}
}