Пример #1
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            _graphicsDevice.Clear(Color.Black);

            spriteBatch.Begin();
            spriteBatch.Draw(Background, new Rectangle(0, 0, game.graphics.PreferredBackBufferWidth, game.graphics.PreferredBackBufferHeight), Color.White);
            spriteBatch.DrawString(fontJetset, countPerfect.ToString(), posPerfect, Color.DarkBlue, 0.0f, new Vector2(0, 0), 2.0f, new SpriteEffects(), 1);
            spriteBatch.DrawString(fontJetset, countGood.ToString(), posGood, Color.Green, 0.0f, new Vector2(0, 0), 2.0f, new SpriteEffects(), 1);
            spriteBatch.DrawString(fontJetset, countBreak.ToString(), posBreak, Color.Red, 0.0f, new Vector2(0, 0), 2.0f, new SpriteEffects(), 1);
            spriteBatch.DrawString(fontJetset, maxChain.ToString(), posMax, Color.Black, 0.0f, new Vector2(0, 0), 2.0f, new SpriteEffects(), 1);
            spriteBatch.DrawString(fontJetset, accuracyFormatted.ToString(), posAccu, Color.Black, 0.0f, new Vector2(0, 0), 2.0f, new SpriteEffects(), 1);
            character.Draw(spriteBatch);
            albumart.Draw(spriteBatch);
            if (windowText != null)
            {
                windowText.Draw(spriteBatch);
            }
            spriteBatch.End();
        }
Пример #2
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            int i;                              //iterative variable

            _graphicsDevice.Clear(Color.Black); // Clear Draw Buffer
            spriteBatch.Begin();

            // Draw Notes
            for (i = 0; i < listnote_active.Count; i++)
            {
                listnote_active[i].Draw(spriteBatch);
            }

            // Draw Overlay
            overlay.Draw(spriteBatch);

            // Draw Album Art and information
            albumart.Draw(spriteBatch);
            spriteBatch.DrawString(fontJetset, songname, new Vector2(10, 270), Color.White);
            spriteBatch.DrawString(fontJetset, artistname, new Vector2(10, 290), Color.White);

            // Draw Overlay widgets
            for (i = 0; i < listbutton.Count; i++)
            {
                listbutton[i].Draw(spriteBatch);
            }

            // Draw Note Hit Effects
            for (i = 0; i < notehits.Count; i++)
            {
                notehits[i].Draw(spriteBatch);
            }

            // Draw Chain Text
            if (Chain > 0 || chainText == "BREAK")
            {
                if (textTimer < textDisappearTime)
                {
                    // Uncomment this stuff to make the text flash
                    if (textflash)
                    {
                        Vector2 vector = fontJetset.MeasureString(chainText);
                        float   length = vector.X;
                        float   posX   = (game.graphics.PreferredBackBufferWidth / 2) - length;
                        spriteBatch.DrawString(fontJetset, chainText, new Vector2(posX, 700), chainColor, 0.0f, new Vector2(0, 0), 2.0f, new SpriteEffects(), 1);
                        if (chainText == "BREAK")
                        {
                            textflash = false;
                        }
                    }
                    else
                    {
                        textflash = true;
                    }
                    textTimer++;
                }
            }

            /**** Debug Text ****/
            //spriteBatch.DrawString(fontJetset, MediaPlayer.PlayPosition.ToString(), new Vector2(10, 10), Color.White);
            //spriteBatch.DrawString(fontJetset, framecount.ToString(), new Vector2(10, 30), Color.White);
            //spriteBatch.DrawString(fontJetset, "BPM = " + bpm.ToString(), new Vector2(10, 50), Color.White);
            //spriteBatch.DrawString(fontJetset, "Offset = " + offset.ToString(), new Vector2(10, 70), Color.White);
            //spriteBatch.DrawString( fontJetset, "Beats Per Sec = " + beatsPerSec.ToString(), new Vector2( 10, 90 ), Color.White );
            //spriteBatch.DrawString( fontJetset, "Frames Per Beat = " + framesPerBeat.ToString(), new Vector2( 10, 110 ), Color.White );
            //spriteBatch.DrawString( fontJetset, "Line 4 = " + linetest, new Vector2( 10, 150 ), Color.White );

            // Draw sprites here
            spriteBatch.End();
        }