Exemple #1
0
 public Form1()
 {
     InitializeComponent();
     Screens.GameScreen ms = new Screens.GameScreen(); // opens new game
     this.Controls.Add(ms);
     ms.Width  = this.Width;
     ms.Height = this.Height; // resizes
     form      = FindForm();
 }
Exemple #2
0
        public static void switchScreen(UserControl current, string next) // takes controls and next screen and switches screens
        {
            UserControl ms = new Screens.ShopScreen();

            switch (next)
            {
            case "game":
                ms = new Screens.GameScreen();
                break;

            case "shop":
                ms = new Screens.ShopScreen();
                break;
            }

            form.Controls.Add(ms);
            form.Controls.Remove(current);
            ms.Width  = form.Width;
            ms.Height = form.Height;
        }