Example #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.White);

            if (phase == GamePhase.Gameplay)
            {
                DrawTD();
                DrawTA();
                DrawTS();
                DrawGameScenes();
            }
            else if (phase == GamePhase.Menu)
            {
                scenes.SelectScene("game");
                scenes.CurrentScene.CreateInput(new Rectangle(0, 0, virtualDims.X, virtualDims.Y), 1);
                scenes.CurrentScene.CreateOutput(new Rectangle(0, 0, windowDims.X, windowDims.Y), true, false);
                scenes.SetupScene(spriteBatch, GraphicsDevice);

                menutex.Draw(spriteBatch, Vector2.Zero);
                currentUI.Draw(spriteBatch);
                cursor.Draw(spriteBatch, scenes.CurrentScene.ToVirtualPos(mouseMan.RawPos()));
                if (transition)
                {
                    transitiontex.Draw(spriteBatch, Vector2.Zero);
                    loader.Draw(spriteBatch, new Vector2(119, 196));
                }
                spriteBatch.End();
            }
            else if (phase == GamePhase.urded)
            {
                scenes.SelectScene("game");
                scenes.CurrentScene.CreateInput(new Rectangle(0, 0, virtualDims.X, virtualDims.Y), 1);
                scenes.CurrentScene.CreateOutput(new Rectangle(0, 0, windowDims.X, windowDims.Y), true, false);
                scenes.SetupScene(spriteBatch, GraphicsDevice);

                dedtex.Draw(spriteBatch, Vector2.Zero);
                cursor.Draw(spriteBatch, scenes.CurrentScene.ToVirtualPos(mouseMan.RawPos()));
                if (transition)
                {
                    transitiontex.Draw(spriteBatch, Vector2.Zero);
                    loader.Draw(spriteBatch, new Vector2(119, 196));
                }
                else
                {
                    handler.drawer.DrawText("aaa", "highscore: wave " + waveNumber, new Rectangle(144, 140, 400, 64), spriteBatch);
                }
                spriteBatch.End();
            }
            spriteBatch.Begin(samplerState: SamplerState.PointWrap);
            GraphicsDevice.SetRenderTarget(null);
            scenes.DrawScene(spriteBatch);
            spriteBatch.End();

            base.Draw(gameTime);
        }
Example #2
0
        } //draw to game scene

        void DrawMenu()
        {
            scenes.SelectScene("menu");
            scenes.SetupScene(spriteBatch, GraphicsDevice);

            if (currentState == GameState.Game)
            {
                mm.SetCompletion((float)GameData.madness / 100);
                mm.Draw(spriteBatch, new Vector2(10, 165));
                dd.SetCompletion(gameTick.timer / gameTick.time);
                dd.Draw(spriteBatch, new Vector2(260, 165));

                DrawMeter(GameData.madness / 2, new Vector2(10, 165));
                //if (GameData.cultExists)
                //    DrawMeter(GameData.daysUntilDoom * 5, new Vector2(135, 165));
                DrawMeter((int)((gameTick.timer / gameTick.time) * 50), new Vector2(260, 165));
            }

            if (currentSubState == GameSubState.Pause)
            {
                pauseBG.Draw(spriteBatch, Vector2.Zero);
                fdrawer.DrawText("font", "Pause", new Rectangle(140, 10, 40, 11), spriteBatch);
            }
            //DRAW
            currentUI.Draw(spriteBatch);
            fdrawer.DrawText("font", tooltipText, new Rectangle((int)tooltipPos.X, (int)tooltipPos.Y, 320 - (int)tooltipPos.X, 180), spriteBatch);

            spriteBatch.End();
        } //draw to menu scene
Example #3
0
        protected override void Draw(GameTime gameTime)
        {
            _spriteBatch.GraphicsDevice.Clear(Color.White);
            _spriteBatch.Begin(sortMode: SpriteSortMode.FrontToBack,
                               blendState: BlendState.AlphaBlend);

            _world.Draw(gameTime);
            _ui.Draw(gameTime);
            base.Draw(gameTime);

            _spriteBatch.End();
        }