Example #1
0
        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(font, "Loadmenu", new Vector2(30, 10), Color.Black);

            backButton.Draw(spriteBatch);
            mainMenuButton.Draw(spriteBatch);
            if (selectedNavButton != null)
            {
                nextButton.Draw(spriteBatch);
            }
            if (xmlNames.Length > (Page + 1) * 10)
            {
                listForwardButton.Draw(spriteBatch);
            }
            if (Page > 0)
            {
                listBackwardButton.Draw(spriteBatch);
            }

            if (xmlNames.Length == 0)
            {
                spriteBatch.DrawString(font, "No Beatmaps to Load.", new Vector2(100, 200), Color.Black);
                spriteBatch.DrawString(font, "Create some with the Beatmap Creator!", new Vector2(100, 230), Color.Black);
            }
            else
            {
                int yOffset = 65;
                int xOffset = 50;

                foreach (String file in pageContents)
                {
                    String[] splittedName = Regex.Split(file, ".xml");

                    loadSelectionButtonList[file].Draw(spriteBatch, new Vector2(xOffset - 10, yOffset - 10));
                    spriteBatch.DrawString(font, splittedName[0], new Vector2(xOffset, yOffset), Color.Black);


                    yOffset += 60;
                    if (yOffset > 340)
                    {
                        yOffset = 65;
                        xOffset = 400;
                    }
                }
            }
        }
Example #2
0
        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(font, "Loadmenu", new Vector2(30, 10), Color.Black);

            mainMenuButton.Draw(spriteBatch);
            if (selectedNavButton != null)
            {
                nextButton.Draw(spriteBatch);
            }
            if (medialib.Songs.Count > (Page + 1) * 10)
            {
                listForwardButton.Draw(spriteBatch);
            }
            if (Page > 0)
            {
                listBackwardButton.Draw(spriteBatch);
            }

            if (medialib.Songs.Count == 0)
            {
                spriteBatch.DrawString(font, "No Songs to Load.", new Vector2(100, 200), Color.Black);
            }
            else
            {
                int yOffset = 65;
                int xOffset = 50;

                foreach (Song file in pageContents)
                {
                    //String[] splittedName = Regex.Split(file, ".mp3");

                    loadSelectionButtonList[file].Draw(spriteBatch, new Vector2(xOffset - 10, yOffset - 10));
                    spriteBatch.DrawString(font, file.Name, new Vector2(xOffset, yOffset), Color.Black);


                    yOffset += 60;
                    if (yOffset > 340)
                    {
                        yOffset = 65;
                        xOffset = 400;
                    }
                }
            }
        }
Example #3
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            spriteBatch.Begin();
            //spriteBatch.DrawString(debugFont, debugstring1, new Vector2(10, 10), Color.Black);
            //spriteBatch.DrawString(debugFont, debugstring2, new Vector2(10, 40), Color.Black);
            //spriteBatch.DrawString(debugFont, debugstring3, new Vector2(10, 70), Color.Black);
            switch (CurrentGameState)
            {
            case GameState.MainMenu:
                //spriteBatch.DrawString(debugFont, gameTimeSinceStart.ToString(), new Vector2(10, 10), Color.Black);
                //spriteBatch.DrawString(debugFont, gameTimeSincePlaying.ToString(), new Vector2(10, 40), Color.Black);
                playBeatmapsButton.Draw(spriteBatch);
                createBeatmapsButton.Draw(spriteBatch);
                gameTimeSinceStart = (int)gameTime.TotalGameTime.TotalMilliseconds;
                break;

            case GameState.Playing:
                //gameTimeSincePlaying = (int)gameTime.TotalGameTime.TotalMilliseconds - gameTimeSinceStart;

                spriteBatch.DrawString(debugFont, PointGenerator.TotalPoints.ToString(), new Vector2(10, 10), Color.Black);
                spriteBatch.DrawString(debugFont, PointGenerator.Multiplicator, new Vector2(10, 30), Color.Black);
                //this.countShakersAndBeats();
                //spriteBatch.DrawString(debugFont, debugstring1, new Vector2(10, 50), Color.Black);
                //spriteBatch.DrawString(debugFont, debugstring2, new Vector2(10, 70), Color.Black);
                //spriteBatch.DrawString(debugFont, endTime.ToString(), new Vector2(10, 90), Color.Black);


                PointGenerator.Draw(spriteBatch, (int)MediaPlayer.PlayPosition.TotalMilliseconds);

                foreach (var kv in BeatDictionary.ToDictionary(kv => kv.Key, kv => kv.Value))
                {
                    if (kv.Key <= MediaPlayer.PlayPosition.TotalMilliseconds)
                    {
                        if (kv.Value.Identifier() == PlayObjectIdentifier.Shaker)
                        {
                            Shaker tempShaker = kv.Value as Shaker;
                            if ((tempShaker.Length + kv.Key) <= (int)MediaPlayer.PlayPosition.TotalMilliseconds)
                            {
                                BeatDictionary.Remove(kv.Key);
                                if (tempShaker.isComplete())
                                {
                                    PointGenerator.generatePointEffect(new Vector2(400f, 240f), PointEffectState.FullPoints, (int)MediaPlayer.PlayPosition.TotalMilliseconds);
                                }
                                else
                                {
                                    PointGenerator.generatePointEffect(new Vector2(400f, 240f), PointEffectState.ReducedPoints, (int)MediaPlayer.PlayPosition.TotalMilliseconds);
                                }
                                checkForEndOfSong();
                            }
                        }
                        else
                        {
                            ClickablePlayObject tempBeat = kv.Value as ClickablePlayObject;
                            if (!tempBeat.thisDraw)
                            {
                                BeatDictionary.Remove(kv.Key);
                                PointGenerator.generatePointEffect(tempBeat.Center, 2f, (int)MediaPlayer.PlayPosition.TotalMilliseconds);
                            }
                        }
                        kv.Value.Draw(spriteBatch);
                    }
                    else
                    {
                        break;
                    }
                }
                spriteBatch.DrawString(debugFont, MediaPlayer.PlayPosition.TotalMilliseconds.ToString(), new Vector2(10, 430), Color.Yellow);

                break;

            case GameState.BeatmapCreator:
                gameTimeSinceCreating = (int)gameTime.TotalGameTime.TotalMilliseconds - gameTimeSinceStart;
                returnToMainMenuButton.Draw(spriteBatch);
                //spriteBatch.DrawString(debugFont, MediaPlayer.PlayPosition.TotalMilliseconds.ToString(), new Vector2(10, 10), Color.Black);
                //spriteBatch.DrawString(debugFont, debugstring1, new Vector2(10, 30), Color.Black);
                //spriteBatch.DrawString(debugFont, debugstring2, new Vector2(10, 50), Color.Black);
                //spriteBatch.DrawString(debugFont, debugstring3, new Vector2(10, 70), Color.Black);
                break;


            case GameState.SaveMenu:

                break;

            case GameState.XMLLoadMenu:
                loadMenu.Draw(spriteBatch);
                break;

            case GameState.SongLoadMenu:
                loadMenu.Draw(spriteBatch);
                break;

            case GameState.ScoreMenu:
                returnToMainMenuButton.Draw(spriteBatch);
                spriteBatch.DrawString(scoreFont, "Final Score:", new Vector2(150, 200), Color.Red);
                spriteBatch.DrawString(scoreFont, PointGenerator.TotalPoints.ToString(), new Vector2(150, 300), Color.Red);
                break;
            }


            spriteBatch.End();
            base.Draw(gameTime);
        }