Exemple #1
0
        // Konstruktor
        public GUIRender(RenderContext rc, BeeTheGame thisGame)
        {
            RC = rc;
            _game = thisGame;
            //GUIHandler an den Kontext anhaengen
            _guiHandler = new GUIHandler();
            _guiHandler.AttachToContext(rc);

            //Bilder einbinden
            _guiImageDummy = new GUIImage("Assets/dummy.png", 0, 0, 0, 5, 5);
            _guiImageBarText = new GUIImage("Assets/nectarCollected.png", 10, 10, -1, 153, 23);

            _guiImageStartBack = new GUIImage("Assets/background.png", 0, 0, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height/9)*2);
            _guiImageGameHelp = new GUIImage("Assets/gameHelp.png", 0, 0, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height/9)*2);
            _guiImageStartBee = new GUIImage("Assets/beePlaceholder.png", 200, 30, 1, 130, 118);
            _guiImageStartPlay = new GUIImage("Assets/play.png", (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width/2 - 300/2), 0, 2, 300, (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height/9)*2);

            _guiImageHelpButton = new GUIImage("Assets/helpButton.png", 10, 10, 2, 41, 50);
            _guiImageHelpOne = new GUIImage("Assets/helpOne.png", 100, 10, 1, 300, 129);
            _guiImageHelpTwo = new GUIImage("Assets/helpTwo.png", 950, 20, 1, 300, 130);

            //Text
            _guiFontArial24 = RC.LoadFont("Assets/arial.ttf", 16);
            _guiArial24 = new GUIText("Score: ", _guiFontArial24, 1200, 25);
            _guiArial24.TextColor = new float4(1, 1, 1, 1);

            //Button
            _guiButtonPlay = new GUIButton((System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width/2 - 300/2), 0, 3, 300, (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height/9)*2);

            _guiButtonPlay.ButtonColor = new float4(0, 0, 0, 0);
            _guiButtonPlay.BorderColor = new float4(0, 0, 0, 1);
            _guiButtonPlay.BorderWidth = 0;

            _guiButtonHelp = new GUIButton(10, 10, 1, 50, 50);
            //Buttonfarbe setzen
            _guiButtonHelp.ButtonColor = new float4(0, 0, 0, 0);
            _guiButtonHelp.BorderColor = new float4(0, 0, 0, 1);
            _guiButtonHelp.BorderWidth = 0;

            //an den Handler anhaengen
            _guiHandler.Add(_guiImageDummy);
            _guiHandler.Add(_guiImageBarText);

            _guiImagePause = new GUIImage("Assets/gamePaused.png", 350, 40, 0, 500, 100);
        }
Exemple #2
0
 public static void Main()
 {
     var app = new BeeTheGame();
     app.Run();
 }