Exemple #1
0
        public override void UpdateAndDraw(Particle particle, float deltaTime, IRenderTarget target)
        {
            particle.Speed += new Vector2(0f, 300f) * deltaTime;
            particle.Color = initialColor.Transition(endColor, particle.Age / particle.Life);
            var backColor = new Color(0, 0, 0, 255).Transition(new Color(0, 0, 0, 0), particle.Age / particle.Life);
            particle.Coordinate += particle.Speed * deltaTime;

            target.DrawTexture(Texture, particle.Coordinate - new Vector2(2f, 2f), backColor, particle.Scale + new Vector2(4f, 4f), Origin, particle.Rotation.Degree, new Rectangle(Vector2.Zero, Texture.Size));
            target.DrawTexture(Texture, particle.Coordinate, particle.Color, particle.Scale, Origin, particle.Rotation.Degree, new Rectangle(Vector2.Zero, Texture.Size));
        }
Exemple #2
0
        public override void UpdateAndDraw(Particle particle, float deltaTime, IRenderTarget target)
        {
            particle.Speed += new Vector2(0f, 300f) * deltaTime;
            particle.Color  = initialColor.Transition(endColor, particle.Age / particle.Life);
            var backColor = new Color(0, 0, 0, 255).Transition(new Color(0, 0, 0, 0), particle.Age / particle.Life);

            particle.Coordinate += particle.Speed * deltaTime;

            target.DrawTexture(Texture, particle.Coordinate - new Vector2(2f, 2f), backColor, particle.Scale + new Vector2(4f, 4f), Origin, particle.Rotation.Degree, new Rectangle(Vector2.Zero, Texture.Size));
            target.DrawTexture(Texture, particle.Coordinate, particle.Color, particle.Scale, Origin, particle.Rotation.Degree, new Rectangle(Vector2.Zero, Texture.Size));
        }
Exemple #3
0
        public override void UpdateAndDraw(Particle particle, float deltaTime, IRenderTarget target)
        {
            particle.Speed      += (LocalCoord - particle.Coordinate).Unit * 800f * deltaTime;
            particle.Rotation   += Angle.FromDegree(180f * deltaTime);
            particle.Coordinate += particle.Speed * deltaTime;
            if ((LocalCoord - particle.Coordinate).Length < 15f)
            {
                particle.Life = 0f;
            }

            target.DrawTexture(Texture, particle.Coordinate, particle.Color, particle.Scale, Vector2.One * .5f, particle.Rotation.Degree, new Rectangle(Vector2.Zero, Texture.Size));
        }
Exemple #4
0
 public override void OnDraw(IRenderTarget target, Vector2 drawPosition)
 {
     target.DrawTexture(Texture, drawPosition, Color * Opacity, Vector2.One, (Texture.Size / 2f).Floor, 0f, new Rectangle(Vector2.Zero, Texture.Size));
     base.OnDraw(target, drawPosition);
 }
Exemple #5
0
 public override void OnDraw(IRenderTarget target, Vector2 drawPosition)
 {
     target.DrawTexture(Texture, drawPosition, Color * Opacity, Vector2.One, (Texture.Size / 2f).Floor, 0f, new Rectangle(Vector2.Zero, Texture.Size));
     base.OnDraw(target, drawPosition);
 }