Exemple #1
0
        protected override void DrawChildren(SpriteBatch sb)
        {
            base.DrawChildren(sb);
            DrawProgressBar(sb);
            Rectangle coverbox = _songImage.GetOuterDimensions().ToRectangle();

            Drawing.DrawAdvBox(sb, new Rectangle(coverbox.X - 2, coverbox.Y - 2, coverbox.Width + 4, coverbox.Height + 4),
                               Color.White, MusicBox.ModTexturesTable["CoverFrame"], new Vector2(10, 10));
            Vector2 drawPos = _progressBar.GetDimensions().Position() - new Vector2(0, 50);

            sb.Draw(Main.magicPixel, new Rectangle((int)(drawPos.X), (int)drawPos.Y, (int)UI_BAR_WIDTH, 3), Color.Gray);


            lock (_spectrumAnalyzer)
            {
                int width = (int)(UI_BAR_WIDTH / 16);
                for (int i = 0; i < _spectrumAnalyzer.SpecturmValue.Length; i++)
                {
                    int height = (int)(_spectrumAnalyzer.SpecturmValue[i] / _spectrumAnalyzer.MaxSpectrumValue * 100f);
                    sb.Draw(Main.magicPixel, new Rectangle((int)(drawPos.X) + width * i,
                                                           (int)(drawPos.Y) - height, width, height), Color.White);
                }


                int cnt = 0;
                foreach (var h in _spectrumAnalyzer.WaveLines)
                {
                    int height = (int)(h * 50);

                    sb.Draw(Main.magicPixel, new Rectangle((int)(drawPos.X + cnt),
                                                           (int)(drawPos.Y) - 50 - height, 1, height * 2), Color.Yellow * 0.75f);
                    cnt++;
                }
                int     y          = (int)(_spectrumAnalyzer.AmplitudeRatio * 100);
                Vector2 ampDrawPos = drawPos - new Vector2(80f, 0f);
                sb.Draw(Main.magicPixel, new Rectangle((int)ampDrawPos.X,
                                                       (int)drawPos.Y - y, 30, y), Color.Cyan * 0.9f);
            }
            // DrawSongList(sb);
        }