Exemplo n.º 1
0
        public static void ShrinkWidth(GumpAnimation anim)
        {
            var p = 1.0 - anim.State.Slice;

            foreach (var e in anim.Entries)
            {
                int w;

                if (e.TryGetWidth(out w))
                {
                    e.TrySetWidth((int)Math.Ceiling(w * p));
                }
            }
        }
Exemplo n.º 2
0
        public static void GrowHeight(GumpAnimation anim)
        {
            var p = anim.State.Slice;

            foreach (var e in anim.Entries)
            {
                int h;

                if (e.TryGetHeight(out h))
                {
                    e.TrySetHeight((int)Math.Ceiling(h * p));
                }
            }
        }
Exemplo n.º 3
0
        public static void Grow(GumpAnimation anim)
        {
            var p = anim.State.Slice;

            foreach (var e in anim.Entries)
            {
                int w, h;

                if (e.TryGetSize(out w, out h))
                {
                    e.TrySetSize((int)Math.Ceiling(w * p), (int)Math.Ceiling(h * p));
                }
            }
        }
Exemplo n.º 4
0
        public static void Shake(GumpAnimation anim)
        {
            var p = anim.State.Slice;

            p = Math.Max(0.0, Math.Min(1.0, p <= 0.5 ? p / 0.5 : (p - 0.5) / 0.5));

            var range = anim.GetArg(0, 5);

            var r = 1 + (int)(p * range);

            foreach (var e in anim.Entries)
            {
                int x, y;

                if (e.TryGetPosition(out x, out y))
                {
                    x = Utility.RandomMinMax(Math.Max(0, x - r), x + r);
                    y = Utility.RandomMinMax(Math.Max(0, y - r), y + r);

                    e.TrySetPosition(x, y);
                }
            }
        }
Exemplo n.º 5
0
 public virtual void OnAnimate(GumpAnimation a)
 {
 }