Пример #1
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            SpriteBatch.Begin();

            board.Draw(SpriteBatch);

            //Draw Score
            Font.Draw(SpriteBatch, FontStyle.Small, 20, 440,
                      String.Format("{0:###,##0}", MarbletsGame.Score));

            if (board.GameOver)
            {
                SpriteBatch.Draw(gameOver, new Vector2(0, 60), Color.White);
            }

            SpriteBatch.End();
        }
Пример #2
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);

            board.Draw(SpriteBatch);

            //Draw Score
            Font.Draw(SpriteBatch, FontStyle.Small, 946, 140,
                      String.Format("{0:###,##0}", MarbletsGame.Score));

            if (board.GameOver)
            {
                SpriteBatch.Draw(gameOver, new Vector2(329, 264), Color.White);
            }

            SpriteBatch.End();
        }
Пример #3
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            SpriteBatch.Begin(SpriteSortMode.Deferred, SpriteBlendMode.AlphaBlend,
                              SaveStateMode.None);

            board.Draw(SpriteBatch);

            //Draw Score

            // Added functionality to account for the screen orientation.
            switch (MarbletsGame.screenOrientation)
            {
            case MarbletsGame.ScreenOrientation.LandscapeRight:
                Font.Draw(SpriteBatch, FontStyle.Large, 83, 100,
                          String.Format("{0:###,##0}", MarbletsGame.Score));

                if (board.GameOver)
                {
                    SpriteBatch.Draw(gameOver, new Vector2(200, 265), null,
                                     Color.White, MarbletsGame.screenRotation, Vector2.Zero, 1.0f, SpriteEffects.None, 0.0f);
                }
                break;

            case MarbletsGame.ScreenOrientation.LandscapeLeft:
                Font.Draw(SpriteBatch, FontStyle.Large, (480 - 48 + 3), (320 - 125),
                          String.Format("{0:###,##0}", MarbletsGame.Score));

                if (board.GameOver)
                {
                    SpriteBatch.Draw(gameOver, new Vector2((320 - 100), (480 - 355)),
                                     null, Color.White, MarbletsGame.screenRotation, Vector2.Zero,
                                     1.0f, SpriteEffects.None, 0.0f);
                }
                break;

            default:
                break;
            }

            SpriteBatch.End();
        }