public DrawableComponent(DrawableComponent other)
 {
     Width        = other.Width;
     Height       = other.Height;
     Alpha        = other.Alpha;
     Rotation     = other.Rotation;
     Position     = other.Position;
     Scale        = other.Scale;
     Origin       = other.Origin;
     Color        = other.Color;
     SpriteEffect = other.SpriteEffect;
     Content      = new ContentManager(other.Content.ServiceProvider, "Content");
 }
Exemple #2
0
        public override void Apply(DrawableComponent component)
        {
            base.Apply(component);
            if (component.Scale.X < MinScale)
            {
                component.Scale = new Vector2(MinScale);
                isReversing     = IsPeriodic;
            }
            else if (component.Scale.X > MaxScale)
            {
                component.Scale = new Vector2(MaxScale);
                isReversing     = IsPeriodic;
            }
            if (isReversing)
            {
                isReversing = false;
                Speed      *= -1;
            }

            component.Scale = new Vector2(component.Scale.X - Speed);
        }
Exemple #3
0
        public override void Apply(DrawableComponent component)
        {
            base.Apply(component);
            component.Alpha -= Speed;

            if (component.Alpha < MinAlpha)
            {
                component.Alpha = MinAlpha;
                isReversing     = IsPeriodic;
            }
            else if (component.Alpha > MaxAlpha)
            {
                component.Alpha = MaxAlpha;
                isReversing     = IsPeriodic;
            }
            if (isReversing)
            {
                isReversing = false;
                Speed      *= -1;
            }
        }
Exemple #4
0
 public override void Restore(DrawableComponent component)
 {
     base.Restore(component);
     component.Scale = new Vector2(defaultScale);
 }
Exemple #5
0
 public override void Restore(DrawableComponent component)
 {
     base.Restore(component);
     component.Alpha = defaultAlpha;
 }