Ejemplo n.º 1
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            if (fader.Visivel)
            {
                principal.SpriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.None);
                fader.Draw(gameTime, principal.SpriteBatch);
                principal.SpriteBatch.End();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Draws all menu items as well as the Main Menu font
        /// </summary>
        /// <param name="spriteBatch"></param>
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Locator.Instance.getService <IResourceLoader>().GetTex("MedicationBackground"), Locator.Instance.getService <CameraManager>().getWorldPosition(Vector2.Zero), Color.White);
            spriteBatch.Draw(Locator.Instance.getService <IResourceLoader>().GetTex("MedicationLogo"), Locator.Instance.getService <CameraManager>().getWorldPosition(new Vector2(290, Game1.Instance.graphics.PreferredBackBufferHeight / 5)), Color.White);
            foreach (MenuItem item in MenuItems)
            {
                item.Draw(spriteBatch);
            }

            f.Draw(spriteBatch);

            base.Draw(spriteBatch);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);
            base.Draw(gameTime);

            _spriteBatch.Begin(transformMatrix: _mainCamera.GetViewMatrix(), samplerState: SamplerState.LinearClamp,
                               blendState: BlendState.AlphaBlend);

            switch (_gameScreen)
            {
            case GameScreen.HomeScreen:
                _homeScreen.Draw(_spriteBatch);
                break;

            case GameScreen.CinematicScreen:
                _cinematicScreen.Draw(_spriteBatch);
                break;

            case GameScreen.InstructionsScreen:
                _instructionScreen.Draw(_spriteBatch);
                break;

            case GameScreen.MainScreen:
                _mainScreen.Draw(_spriteBatch);
                break;

            case GameScreen.GameOverScreen:
                _gameOverScreen.Draw(_spriteBatch);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            _screenFader.Draw(_spriteBatch);

            _spriteBatch.End();

            if (_drawDebug)
            {
                DrawDebug();
            }
        }