Beispiel #1
0
        public void Draw(SpriteBatch sb)
        {
            switch (currState)
            {
            case BMenuState.MINI:
                menubg.Draw(sb, new Point(0, 520));
                break;

            case BMenuState.SEMI:
                menubg.Draw(sb, new Point(0, 436));
                menu.Draw(sb);
                break;

            case BMenuState.ARMS:
            case BMenuState.SKILL:
                menubg.Draw(sb, new Point(0, 105));
                menu.Draw(sb);
                skill.Draw(sb, new Point(17, 513));
                break;

            case BMenuState.ITEM:
                menubg.Draw(sb, new Point(0, 105));
                menu.Draw(sb);
                item.Draw(sb, new Point(130, 508));
                break;
            }
        }
Beispiel #2
0
        public void Draw(SpriteBatch spriteBatch, int points, int coins, int zone, int level, int time, WorldState state)
        {
            spriteBatch.Begin();

            spriteBatch.DrawString(Fonts.CourierNew, "Mario", marioPos, Color.White);
            String strPoints = points.ToString().PadLeft(6, '0');

            spriteBatch.DrawString(Fonts.CourierNew, strPoints, pointsPos, Color.White);

            StaticSprite coin = new StaticSprite(Textures.Coin);

            coin.Draw(spriteBatch, coinPos, Color.White, 1.5f, true);

            String strCoins = "x" + coins.ToString().PadLeft(2, '0');

            spriteBatch.DrawString(Fonts.CourierNew, strCoins, coinsPos, Color.White);

            spriteBatch.DrawString(Fonts.CourierNew, "World", worldPos, Color.White);
            String strLevel = zone.ToString() + "-" + level.ToString();

            spriteBatch.DrawString(Fonts.CourierNew, strLevel, levelPos, Color.White);

            spriteBatch.DrawString(Fonts.CourierNew, "Time", timePos, Color.White);
            String strTimeLeft = (time / 30).ToString().PadLeft(3, '0');

            spriteBatch.DrawString(Fonts.CourierNew, strTimeLeft, timeLeftPos, Color.White);

            if (state == WorldState.PAUSED)
            {
                spriteBatch.DrawString(Fonts.CourierNew, "Paused", pausedPos, Color.White);
            }
            spriteBatch.End();
        }
        public override void Draw(GameTime gameTime)
        {
            lhg.GraphicsDevice.Clear(Color.Black);

            lhg.MySpriteBatch.Begin();
            background.Draw(gameTime);
            playerHUD.Draw(gameTime);
            lhg.MySpriteBatch.End();

            //the SpriteBatch added below to draw the current technique name
            //is changing some needed render states, so they are reset here.
            lhg.GraphicsDevice.DepthStencilState = DepthStencilState.Default;

            //draw the reference grid so it's easier to get our bearings
            grid.Draw();
            base.Draw(gameTime);
        }
Beispiel #4
0
        public override void Draw(GameTime gameTime)
        {
            spriteBatch.DrawString(font, copyrightInfo, new Vector2(300, 3), Color.Yellow);

            if (playerSprite != null)
            {
                playerSprite.Draw(gameTime);
            }

            int j = 0;

            spriteBatch.DrawString(font, playerName, new Vector2(xOffset + 5, yOffset + font.LineSpacing * (j)), Color.Yellow);
            j++;
            spriteBatch.DrawString(font, actionPoints, new Vector2(xOffset + 5, yOffset + font.LineSpacing * (j)), Color.Yellow);
            j++;
            spriteBatch.DrawString(font, hitPoints, new Vector2(xOffset + 5, yOffset + font.LineSpacing * (j)), Color.Yellow);
            j++;

            base.Draw(gameTime);
        }
Beispiel #5
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);

            Resolution.BeginDraw();

            spriteBatch.Begin(SpriteSortMode.Immediate,
                              BlendState.AlphaBlend,
                              SamplerState.PointClamp, null, null, null,
                              Resolution.getTransformationMatrix());
            backdrop.Draw(spriteBatch);

            if (player.Mode != Player_Modes.MainMenu && player.Mode != Player_Modes.Tutorial &&
                player.Mode != Player_Modes.ES_Passive && player.Mode != Player_Modes.ES_God &&
                player.Mode != Player_Modes.ES_Death && player.Mode != Player_Modes.End_Screen)
            {
                terrain.Draw(spriteBatch);
                grid.Draw(spriteBatch, player.SelectedBuilding);
                architech.Draw(spriteBatch, player, grid);
                os.Draw(spriteBatch, player);
                wizard.Draw(spriteBatch);
                light.Draw(spriteBatch);
            }

            else if (player.Mode == Player_Modes.MainMenu || player.Mode == Player_Modes.Tutorial || player.Mode == Player_Modes.ES_Death ||
                     player.Mode == Player_Modes.ES_God || player.Mode == Player_Modes.ES_Passive || player.Mode == Player_Modes.End_Screen)
            {
                overlay_Screen.Draw(spriteBatch);
            }

            uiMaster.Draw(spriteBatch, player);
            player.Draw(spriteBatch);
            spriteBatch.End();

            base.Draw(gameTime);
        }
Beispiel #6
0
 /// <summary>
 /// Draws the room.
 /// </summary>
 /// <param name="sb">The SpriteBatch to draw with</param>
 public void Draw(SpriteBatch sb)
 {
     background.Draw(sb, new Point(-StaticVars.Camera.X, -StaticVars.Camera.Y));
 }
Beispiel #7
0
 public override void Draw(SpriteBatch sb)
 {
     sprite.Draw(sb, new Point(location.X - StaticVars.Camera.X, location.Y - StaticVars.Camera.Y));
 }