Esempio n. 1
0
 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");
 }
Esempio n. 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);
        }
Esempio n. 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;
            }
        }
Esempio n. 4
0
 public override void Restore(DrawableComponent component)
 {
     base.Restore(component);
     component.Scale = new Vector2(defaultScale);
 }
Esempio n. 5
0
 public override void Restore(DrawableComponent component)
 {
     base.Restore(component);
     component.Alpha = defaultAlpha;
 }