Beispiel #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Black);
            GetForm().TopMost = true;
            GetForm().Show();
            GetForm().BringToFront();

            if (isShow)
            {
                GetForm().Location = new System.Drawing.Point(0, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height - imageHeight);

                spriteBatch.Begin();
                Vector2 centerImagePosition = new Vector2(0, (isShow ? 300 : 150) - imageHeight);
                spriteBatch.Draw(arts[index] == null ? Nova_DataBase.GetTexture("default") : arts[index], new Microsoft.Xna.Framework.Rectangle((int)centerImagePosition.X, (int)centerImagePosition.Y, imageWidth, imageHeight), Microsoft.Xna.Framework.Color.White);
                Nova_Functions.DrawBorderString(spriteBatch, Nova_DataBase.GetFont("font"), songs[index].Name.Substring(songs[index].Name.IndexOf("Musics") + 1 + "Musics".Length), new Vector2(550, 10), Microsoft.Xna.Framework.Color.Red, Microsoft.Xna.Framework.Color.Blue);
                spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive);
                foreach (Nova_Particle p in particles)
                {
                    p.Draw(spriteBatch);
                }
                spriteBatch.End();
            }
            else
            {
                GetForm().Opacity  = 0.5f;
                GetForm().Location = new System.Drawing.Point(0, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height - imageHeight / 2);
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive);
                Nova_Particle.DoDrawParticles(emiters, spriteBatch);
                spriteBatch.End();
            }

            base.Draw(gameTime);
        }
Beispiel #2
0
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            Controls();
            ControlOpacity(gameTime);
            foreach (Nova_Particle p in particles)
            {
                p.Update(gameTime, Matrix.CreateTranslation(0, 0, 0));
            }
            if (!isShow)
            {
                Nova_Particle p = new Nova_Particle();
                p.SetTexture(Nova_DataBase.GetTexture("bar"), SpriteEffects.None, Microsoft.Xna.Framework.Color.Blue);
                p.Position        = new Vector2(0, 75);
                p.LifeTime        = 1500;
                p.InitialLifeTime = 1500;
                p.SetFadeOut(1500);
                p.IsAllColorsUntilDie = true;
                p.SetDirectionSpeed(new Vector2(20, 0));
                p.inflateSizeHeight = (int)(sumPower * 3);
                p.SetInternalRotation(0, 1, Nova_Functions.GetCenterOf(p.GetCurrentTexture()), Nova_Particle.RotationDirectionEnum.clockwise);
                p.inflateSizeWidth = 10;
                emiters.Add(p);

                Nova_Particle.DoUpdateParticles(emiters, gameTime, Matrix.CreateTranslation(0, 0, 0));
            }
            UpdatePlayer();
        }
Beispiel #3
0
 private void LoadParticles()
 {
     for (int i = 0; i < 256; i++)
     {
         Nova_Particle p = new Nova_Particle();
         p.SetTexture(Nova_DataBase.GetTexture("bar"), SpriteEffects.None, Microsoft.Xna.Framework.Color.Purple);
         p.Position   = new Vector2(imageWidth + 50 + (i * 5), 160);
         particles[i] = p;
     }
 }
Beispiel #4
0
 private void LoadParticles()
 {
     for (int i = 0; i < QTD_BARS; i++)
     {
         Nova_Particle p = new Nova_Particle();
         p.SetTexture(Nova_DataBase.GetTexture("bar"), SpriteEffects.None, Microsoft.Xna.Framework.Color.White);
         p.ParticleColor = Nova_Functions.HSVToColor((6f / (float)QTD_BARS * i), 1, 1);
         // p.Position = new Vector2(((float)Nova_Functions.View.Width / QTD_BARS) * i, Nova_Functions.View.Height / 2 - p.GetCurrentTexture().Height / 2);
         p.Position = new Vector2(((float)Nova_Functions.View.Width / QTD_BARS) * i, 0);
         // p.SetAngle(-i, Nova_Functions.GetCenterOf(p.GetCurrentTexture()));
         // p.SetDirectionRotation(400, 200, 0, 0, i, i, 0, 0, true);
         p.IsInflateBothSides = true;
         particles[i]         = p;
     }
 }
Beispiel #5
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Nova_Importer.SetContent(Content);
            Nova_Functions.SetViewport(GraphicsDevice);

            int resourceNumber = 0;

            foreach (FileInfo file in new DirectoryInfo(MUSIC_PATH).GetFiles("*.mp3", SearchOption.AllDirectories))
            {
                songs.Add((Song)Nova_Importer.LoadExternalAndReturn(Path.Combine(Environment.CurrentDirectory, "Content", "Musics"), file, "MUSIC" + resourceNumber.ToString(), Nova_Importer.ImportType.Music));
                TagLib.File fileB = TagLib.File.Create(file.FullName);
                if (fileB.Tag.Pictures.Any())
                {
                    byte[] bin           = fileB.Tag.Pictures[0].Data.Data;
                    String imageFileDest = Path.Combine(Path.GetTempPath(), Nova_Functions.GetFileName(file) + "IMAGE" + ".jpg");
                    Image.FromStream(new MemoryStream(bin)).Save(imageFileDest, System.Drawing.Imaging.ImageFormat.Jpeg);
                    arts.Add((Texture2D)Nova_Importer.LoadExternalAndReturn(Path.Combine(Environment.CurrentDirectory, "Content", "Images"), new FileInfo(imageFileDest), Nova_Functions.GetFileName(file) + "IMAGE", Nova_Importer.ImportType.Texture));
                }
                else
                {
                    arts.Add(null);
                }

                resourceNumber++;
            }
            Nova_Importer.LoadResource("font", "font");
            Nova_Importer.LoadResource("default", "default");
            Nova_Importer.LoadResource("bar", "bar");

            if (arts[arts.Count - 1] == null)
            {
                arts[arts.Count - 1] = Nova_DataBase.GetTexture("default");
            }

            LoadParticles();


            Nova_Audio.playMusicViaSound(songs[0]);
        }