Example #1
0
 public override void Draw(SpriteBatch spriteBatch)
 {
     base.Draw(spriteBatch);
     CatalogList.Draw(spriteBatch);
     LastButton.Draw(spriteBatch);
     PageScope.Draw(spriteBatch);
     NextButton.Draw(spriteBatch);
 }
Example #2
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            AlignText(WinningText, Alignment.Center, 25);
            AlignText(ScoreText, Alignment.Center, 175);

            ScoreText.Text = DisplayedScore.ToString("N0");

            WinningText.Draw(spriteBatch);
            ScoreText.Draw(spriteBatch);

            RestartButton.Draw(spriteBatch);
            NextButton.Draw(spriteBatch);

            Star1.Draw(spriteBatch);
            Star2.Draw(spriteBatch);
            Star3.Draw(spriteBatch);
        }
Example #3
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            MapManager.Instance.Draw(spriteBatch);
            LevelManager.Instance.Draw(spriteBatch);
            Actor.Instance.Draw(spriteBatch);

            // Affichage des boutons
            design_button.Draw(spriteBatch);
            fire_button.Draw(spriteBatch);
            water_button.Draw(spriteBatch);
            next_button.Draw(spriteBatch);
            previous_button.Draw(spriteBatch);
            refresh_button.Draw(spriteBatch);
            sound_button.Draw(spriteBatch);
            music_button.Draw(spriteBatch);
            menu_button.Draw(spriteBatch);

            // Affichage du score
            int current_moves = LevelManager.Instance.currentLevel.moves;
            int min_moves     = LevelManager.Instance.currentLevel.min_moves;

            spriteBatch.DrawString(ScreenManager.Instance.sprite_font,
                                   string.Format("{0} ({1})", current_moves, min_moves),
                                   position_texte_score, Color.Black, 0, Vector2.Zero, 1.5f, SpriteEffects.None, 0);

            // info-bulles sur le score
            MouseState current_state = Mouse.GetState();
            Rectangle  mouse_rect    = new Rectangle(current_state.X, current_state.Y, 1, 1);
            Rectangle  score_rect    = new Rectangle(0, 0, 64, 32);

            if (info_bulle.Length > 0 && mouse_rect.Intersects(score_rect))
            {
                spriteBatch.DrawString(ScreenManager.Instance.sprite_font, info_bulle, new Vector2(0, 1.3f * 32), Color.White);
            }

            // Affichage de l'information du niveau (sur le coté)
            string level      = string.Format("LEVEL {0}", LevelManager.Instance.levelIndex + 1);
            int    position_y = 2 * Tile.Height;

            foreach (char c in level)
            {
                float scale = 1;
                Color color = Color.LightGray;
                if (System.Char.IsDigit(c))
                {
                    scale = 2;

                    if (MenuScreen.levels.difficulty[LevelManager.Instance.levelIndex] == 0)
                    {
                        color = Color.LightGreen;
                    }
                    else if (MenuScreen.levels.difficulty[LevelManager.Instance.levelIndex] == 1)
                    {
                        color = Color.Orange;
                    }
                    else if (MenuScreen.levels.difficulty[LevelManager.Instance.levelIndex] == 2)
                    {
                        color = Color.Red;
                    }
                    else if (MenuScreen.levels.difficulty[LevelManager.Instance.levelIndex] == 3)
                    {
                        color = Color.Violet;
                    }
                    else if (MenuScreen.levels.difficulty[LevelManager.Instance.levelIndex] == 4)
                    {
                        color = Color.Aqua;
                    }
                    else
                    {
                        color = Color.White;
                    }
                }

                position_title = new Vector2(ScreenManager.Instance.Dimension.X - 20, position_y);
                spriteBatch.DrawString(ScreenManager.Instance.sprite_font,
                                       c.ToString(), position_title, color, 0,
                                       Vector2.Zero, scale, SpriteEffects.None, 0);

                position_y += Tile.Height;
            }

            base.Draw(spriteBatch);
        }