Ejemplo n.º 1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            particleEffect = ParticleEffect2DFactory.Initialize(1000, 2000)
                .SetEmissionPattern(new RectangleEmissionPattern(300, 300))
                .SetMaxParticleSpeed(5f)
                .SetEmitAmount(75)
                .AddTexture(Content.Load<Texture2D>("star.png"))
                .AddModifier(new AlphaAgeTransform())
                .AddModifier(new ColorAgeTransform {EndColor = Color.AliceBlue, StartColor = Color.BlueViolet})
                .AddModifier(new ConstantRotation {Strength = 5})
                .Create();
        }
Ejemplo n.º 2
0
 public static ParticleEffect2DFactory Initialize(int maxParticles, int particleLifespan)
 {
     var particleEffect = new ParticleEffect2D(maxParticles, particleLifespan);
     return new ParticleEffect2DFactory(particleEffect);
 }
Ejemplo n.º 3
0
 private ParticleEffect2DFactory(ParticleEffect2D particleEffect)
 {
     this.particleEffect = particleEffect;
 }