A proxy to a particle effect
        protected override void LoadContent()
        {
            this.ParticleEffect = Game.Content.Load<ParticleEffect>("Demo1");

            for (int i = 0; i < this.ParticleEffect.Emitters.Count; i++)
                this.ParticleEffect.Emitters[i].ParticleTexture = Game.Content.Load<Texture2D>("Star");

            Proxy1 = new ParticleEffectProxy(ParticleEffect) { World = Matrix.CreateScale(.5f) * Matrix.CreateTranslation(800, 0, 0) };
            Proxy2 = new ParticleEffectProxy(ParticleEffect) { World = Matrix.CreateScale(.1f) * Matrix.CreateTranslation(-900, 0, 0) };
            
            base.LoadContent();
        }
Exemple #2
0
        public override void Initialize()
        {
            this.ParticleEffect = new ParticleEffect
                                      {
                                          Emitters = new EmitterCollection
                                                         {
                                                             new LineEmitter
                                                                 {
                                                                     Budget = 15000,
                                                                     BillboardStyle = BillboardStyle.Spherical,
                                                                     Length = 800,
                                                                     EmitBothWays = true,
                                                                     ConstrainToPlane = true,
                                                                     Rectilinear = true,
                                                                     Term = 3f,
                                                                     BlendMode = EmitterBlendMode.Add,
                                                                     ReleaseColour = Color.SteelBlue.ToVector3(),
                                                                     ReleaseOpacity = 1,
                                                                     ReleaseQuantity = 20,
                                                                     ReleaseScale = new Range(16f, 22f),
                                                                     ReleaseSpeed = new Range(1f, 3f),
                                                                     Modifiers = new ModifierCollection
                                                                                     {
                                                                                         new OpacityFastFadeModifier
                                                                                             {InitialOpacity = 0.25f},
                                                                                         new ColourInterpolator2
                                                                                             {
                                                                                                 InitialColour =
                                                                                                     Color.DarkRed.
                                                                                                     ToVector3(),
                                                                                                 FinalColour =
                                                                                                     Color.Yellow.
                                                                                                     ToVector3()
                                                                                             },
                  },
                                                                 },
                                                         },
                                      };




            this.ParticleEffect.Emitters[0].Initialise();

            Proxy1 = new PointToPointProxy(ParticleEffect) { Start = new Vector3(0,0,0), End = new Vector3(121, -210, -310), OriginalEffectSize  = 800};
            Proxy2 = new ParticleEffectProxy(ParticleEffect);
            
            base.Initialize();
        }