コード例 #1
0
        public void Draw(SpriteBatch sb)
        {
            String text = HotDAMN.TEXT_GAME_OVER;

            Vector2         textSize   = Textures.font.MeasureString(text);
            Vector2         textCenter = new Vector2(Game.GraphicsDevice.Viewport.Width / 2, (Game.GraphicsDevice.Viewport.Height / 2));
            IAnimatedSprite background = new BackgroundAnimation(Color.Black);

            background.Draw(sb, 0, 0);
            sb.DrawString(Textures.font, text, textCenter - (textSize / 2), Color.White);

            HUD.Draw(sb, HotDAMN.TEXT_EMPTY_STRING);
        }
コード例 #2
0
ファイル: SLevelIntro.cs プロジェクト: mmcgaha/SuperMarioBros
        public void Draw(SpriteBatch sb)
        {
            String text = HotDAMN.TEXT_WORLD + levelName.Replace('0', ' ');

            Vector2         textSize   = Textures.font.MeasureString(text);
            Vector2         textCenter = new Vector2(Game.GraphicsDevice.Viewport.Width / 2, (Game.GraphicsDevice.Viewport.Height / 2) - 35);
            IAnimatedSprite background = new BackgroundAnimation(Color.Black);
            IAnimatedSprite mario      = new MarioAnimation(HUD.currentPlayer == 0 ? Textures.mario0 : Textures.luigi0, Textures.smallRightIdle);

            background.Draw(sb, 0, 0);
            mario.Draw(sb, (int)(textCenter.X - (textSize.X / 2)) + 15, (int)(textCenter.Y - (textSize.Y / 2)) + 25);
            sb.DrawString(Textures.font, HotDAMN.TEXT_X, new Vector2(textCenter.X - (textSize.X / 2) + 35, textCenter.Y - (textSize.Y / 2) + 43), Color.White);
            sb.DrawString(Textures.font, HUD.LIVES[HUD.currentPlayer].ToString(), new Vector2(textCenter.X - (textSize.X / 2) + 55, textCenter.Y - (textSize.Y / 2) + 43), Color.White);


            sb.DrawString(Textures.font, text, textCenter - (textSize / 2), Color.White);

            HUD.Draw(sb, levelName);
        }