Beispiel #1
0
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            Resolution.BeginDraw();

            //Draw when UNPAUSED
            if (GameState == GameStates.Normal)
            {
                totalFrames++;
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Resolution.getTransformationMatrix());

                cubeEffect.View = Matrix.CreateLookAt(new Vector3(px, ay, py), new Vector3(cx, cz, cy), Vector3.Up);
                // Set the Projection matrix which defines how we see the scene (Field of view)
                ScreenManager.Game.GraphicsDevice.BlendState        = BlendState.Opaque;
                ScreenManager.Game.GraphicsDevice.DepthStencilState = DepthStencilState.Default;
                cubeEffect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, aspectRatio, 1.0f, 1000.0f);
                DrawCubes();

                spriteBatch.End();

                displayFPS(gameTime);
            }
            //DRAW WHEN PAUSED
            else if (GameState == GameStates.Paused)
            {
                totalFrames++;
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Resolution.getTransformationMatrix());

                spriteBatch.End();
            }
            drawn  = 0; //Reset Draws
            culled = 0;
        }
Beispiel #2
0
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            Resolution.BeginDraw();

            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Resolution.getTransformationMatrix());
            spriteBatch.Draw(backgroundTexture, Vector2.Zero, Color.White);
            spriteBatch.Draw(picture, Vector2.Zero, Color.White);
            spriteBatch.End();
        }
        public override void Draw(GameTime gameTime)
        {
            Resolution.BeginDraw();
            SpriteBatch spriteBatch    = ScreenManager.SpriteBatch;
            Viewport    viewport       = ScreenManager.Game.GraphicsDevice.Viewport;
            Vector2     buttonTextureL = new Vector2(478, 486);

            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Resolution.getTransformationMatrix());
            spriteBatch.Draw(backgroundTexture, Vector2.Zero, Color.White);
            spriteBatch.Draw(buttonTexture, buttonTextureL, Color.White);
            spriteBatch.End();
        }
Beispiel #4
0
        public override void Draw(GameTime gameTime)
        {
            // Sets up the auto-scale resolution class
            Resolution.BeginDraw();
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            // SpriteBatch auto-scaling properties. Will scale based on current resolution on a matrix against the 1280x720 default
            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Resolution.getTransformationMatrix());
            spriteBatch.Draw(backgroundTexture, Vector2.Zero, Color.White);
            DrawText();
            spriteBatch.End();
            base.Draw(gameTime);
        }
        public override void Draw(GameTime gameTime)
        {
            // This automatically draws whatever BackgroundTexture you define on a splashscreen, therefore there is no
            // need to have a draw method on each screen.
            Resolution.BeginDraw();
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            Viewport    viewport    = ScreenManager.Game.GraphicsDevice.Viewport;

            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Resolution.getTransformationMatrix());
            DrawFade(spriteBatch, viewport);
            spriteBatch.Draw(backgroundTexture, Vector2.Zero, Color.White * ScreenAlpha);
            spriteBatch.End();
        }