示例#1
0
        public override void Draw(GameTime gameTime)
        {
            DrawTextures();

            GraphicsDevice.SetRenderTarget(null);

            PushSpriteBatch(blendState: NonPremultiplied, samplerState: SamplerState.PointWrap, projection: Projection);

            Menu.Draw(this);

            PopSpriteBatch();
        }
示例#2
0
        public override void Draw(GameTime gameTime)
        {
            GraphicsDevice.SetupRenderTarget(ref GrassNoise, GrassWidth * 16, GrassHeight * 16);
            GraphicsDevice.SetupRenderTarget(ref GrassMap, Viewport.Width, Viewport.Height);
            CameraTarget.Setup(this, Viewport.Width, Viewport.Height);

            WorldTransform = Matrix.Identity;
            ApplyScreenShake(ref WorldTransform);

            Projection = Matrix.CreateOrthographicOffCenter(0, Viewport.Width, Viewport.Height, 0, 0, -1);

            DrawTextures();

            //SetRenderTarget(null);

            SetRenderTarget(CameraTarget.A);

            PushSpriteBatch(blendState: NonPremultiplied, samplerState: SamplerState.PointWrap, transform: WorldTransform, projection: Projection, shader: Shader, shaderSetup: (transform, projection) =>
            {
                SetupColorMatrix(ColorMatrix.Identity, transform, projection);
            });

            DrawBackground();

            FlushSpriteBatch();

            DrawGround();
            DrawMorpho();

            if (TitleSM.CurrentState >= TitleState.TextSlash)
            {
                DrawText();
            }

            PopSpriteBatch();

            SetRenderTarget(CameraTarget.B);
            CameraTarget.Swap();

            //Draw screenflashes
            ColorMatrix color = ColorMatrix.Identity;

            ApplyScreenFlash(ref color);

            PushSpriteBatch(samplerState: SamplerState.PointWrap, blendState: NonPremultiplied, shader: Shader, transform: Matrix.Identity, projection: Projection, shaderSetup: (transform, projection) =>
            {
                SetupColorMatrix(ColorMatrix.Identity, transform, projection);
            });

            PushSpriteBatch(shader: Shader, shaderSetup: (transform, projection) =>
            {
                SetupColorMatrix(color, transform, projection);
            });
            SpriteBatch.Draw(CameraTarget.B, CameraTarget.B.Bounds, Color.White);
            PopSpriteBatch();

            CameraTarget.Swap();

            SetRenderTarget(null);

            SpriteBatch.Draw(CameraTarget.B, CameraTarget.B.Bounds, Color.White);

            Menu.Draw(this);

            foreach (var particle in Particles)
            {
                particle.Draw(this);
            }

            PopSpriteBatch();
        }