Пример #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);
        }
Пример #2
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Black);
            GetForm().TopMost = true;
            GetForm().Opacity = opacity;
            if (change)
            {
                GetForm().Size = new Size(Nova_Functions.View.Width, Nova_Functions.View.Height);

                GetForm().Show();
                GetForm().BringToFront();
            }
            change = false;
            GraphicsDevice.SetRenderTarget(target);
            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive);

            Nova_Particle.DoDrawParticles(emitersText, spriteBatch);
            Nova_Particle.DoDrawParticles(particles.ToList(), spriteBatch);
            //for ( int i = 0; i < emiters.Count; i++)
            //{
            //    Nova_Particle p = emiters[i];
            //    p.Draw(spriteBatch);
            //    if (p.LifeTime <= 0)
            //    {
            //        emiters.Remove(p);
            //        i--;
            //    }
            //}
            spriteBatch.End();

            GraphicsDevice.SetRenderTarget(null);
            spriteBatch.Begin(0, BlendState.Additive);
            spriteBatch.Draw(target, Vector2.Zero, Microsoft.Xna.Framework.Color.White);
            spriteBatch.Draw(target, Nova_Functions.ReturnScreenRectangle(), null, Microsoft.Xna.Framework.Color.White, 0, Vector2.Zero, SpriteEffects.FlipVertically | SpriteEffects.FlipHorizontally, 1f);
            spriteBatch.End();
            base.Draw(gameTime);
        }