Example #1
0
        public StartScreen()
        {
            BattleGUI.InitializeResources();
            bIsRunning    = true;
            r2d           = new RenderTarget2D(Game1.graphics.GraphicsDevice, 1366, 768);
            bg.texFileLoc = @"Graphics\StartScreen\StartBG";
            bg.animationFrames.Add(new Rectangle(0, 0, 1366, 768));
            bg.ReloadTexture();

            sf = Game1.contentManager.Load <SpriteFont>(@"Fonts\Design\BGUI\test48");
            //testSF = Game1.contentManager.Load<SpriteFont>(@"Fonts\Design\BGUI\test");
            //testSF20 = Game1.contentManager.Load<SpriteFont>(@"Fonts\Design\BGUI\test20");
            //testSF25 = Game1.contentManager.Load<SpriteFont>(@"Fonts\Design\BGUI\test25");
            //testSF32 = Game1.contentManager.Load<SpriteFont>(@"Fonts\Design\BGUI\test32");
            //testSF48 = Game1.contentManager.Load<SpriteFont>(@"Fonts\Design\BGUI\test48");
            int width  = 800;
            int deltaH = 28;
            int height = (400 - deltaH * 5) / 4;

            Rectangle b = new Rectangle((1366 - width) / 2, 400, 800, height);

            mButtons.Add(new SCButton(b, sf, "New Game"));
            b.Y += height + deltaH;
            mButtons.Add(new SCButton(b, sf, "Load Game"));
            b.Y += height + deltaH;
            mButtons.Add(new SCButton(b, sf, "Settings"));
            b.Y += height + deltaH;
            mButtons.Add(new SCButton(b, sf, "Exit Game"));
            sc = this;

            Utilities.Control.Player.PlayerController.InitializeStartScreenControls(this);
        }
Example #2
0
        internal LoadGameScreen(String loadLoc, StartScreen sc = null)
        {
            func    = null;
            this.sc = sc;
            if (!bInitialize)
            {
                Initialize();
            }

            loadLocation = loadLoc;
            LoadFileTab.SetScroll(0f);
            GenerateTabs();
        }
Example #3
0
        internal LoadGameScreen(String loadLoc, ExecuteFunction f)
        {
            func    = f;
            this.sc = null;
            if (!bInitialize)
            {
                Initialize();
            }

            loadLocation = loadLoc;
            LoadFileTab.SetScroll(0f);
            saveDatas.Add(new PlayerSaveData());
            saveDatas.Last().timeIndex = long.MaxValue - 1;
            GenerateTabs();
        }
Example #4
0
        public void Update(GameTime gt, StartScreen sc)
        {
            if (sc.selectedButton != this)
            {
                if (bSelected)
                {
                    Unselect();
                }
            }
            else if (!bSelected && sc.selectedButton == this)
            {
                Select();
            }

            if (bSelected)
            {
                timePassed += gt.ElapsedGameTime.Milliseconds;
                if (timePassed > colorTimer)
                {
                    timePassed = 0;
                    if (bGoingDown)
                    {
                        tc.R += 1;
                        tc.G += 1;
                        tc.B += 1;
                        if (tc.R > 100)
                        {
                            bGoingDown = false;
                        }
                    }
                    else
                    {
                        tc.R -= 1;
                        tc.G -= 1;
                        tc.B -= 1;
                        if (tc.R <= 0)
                        {
                            bGoingDown = true;
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //  Console.WriteLine(SteamFriends.GetPersonaName());


            base.Initialize();
            initiateActions();

            ResolutionUtility.bMouseIsVisible = this.IsMouseVisible;
            hitboxHelp       = Content.Load <Texture2D>(@"Graphics\HitBoxHelp");
            selectionTexture = Content.Load <Texture2D>(@"Graphics\MainMenu\TestRectangle");
            mapBorderHelp    = Content.Load <Texture2D>(@"Graphics\Tiles\Basic\BorderTest");
            WhiteTex         = Content.Load <Texture2D>(@"White");
            scenes.Insert((int)(Screens.MainMenu), new MainMenu());
            scenes.Insert((int)(Screens.MainGameStart), new NewGameScene());
            scenes.Insert((int)(Screens.MainGameContinue), new ContinueGameScene());
            scenes.Insert((int)(Screens.OWGame), new OWGame());
            scenes.Insert((int)(Screens.BGame), new MainGame());
            scenes.Insert((int)(Screens.Options), new Options());
            scenes.Insert((int)(Screens.ExitGame), new Scene());
            scenes.Insert((int)(Screens.Editor), new Editor());


            CursorUtility.Initialize(this);
            MainGUI.Initialize(this);


            if (!bRunEditMode)
            {
                scenes[SceneUtility.currentScene].Initialize(this);
            }



            graphics.PreferMultiSampling       = true;
            graphics.PreferredBackBufferWidth  = this.GraphicsDevice.DisplayMode.Width;
            graphics.PreferredBackBufferHeight = this.GraphicsDevice.DisplayMode.Height;
            //   this.Window.Position = new Point(100, 100);
            //graphics.IsFullScreen = true;
            this.IsMouseVisible = false;
            graphics.ApplyChanges();
            LoadAssets();
            this.Window.AllowUserResizing = false;
            //Window.IsBorderless = true;
            Window.AllowAltF4 = true;
            //Window.Location = Point.Zero;
            //900,506
            ResolutionUtility.WindowSizeBeforeFullScreen = new Vector2(1366, 768);
            ResolutionUtility.AdjustResolution(1366, 768, graphics);
            gameRender  = new RenderTarget2D(GraphicsDevice, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            gameRender  = new RenderTarget2D(GraphicsDevice, 1366, 768);
            UIRender    = new RenderTarget2D(GraphicsDevice, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            monitorSize = new Vector2(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
            Console.WriteLine("Primary Monitor Size: " + monitorSize);

            EditorFileWriter.LoadSaveSettings();
            startScreen = new StartScreen();
#if !DEBUG
            // GameProcessor.Launch();
#endif
            // GameProcessor.Launch();
        }