Example #1
0
        public override void Update(BaseScene scene, FrameTick elapsedTime)
        {
            MultiAnim anim = new MultiAnim(Anim, (float)Range / DefaultRadius, Origin + Dir.GetLoc() * Offset, Dir, LocHeight, Cycles);

            scene.Anims[(int)Layer].Add(anim);
            finished = true;
        }
Example #2
0
 protected MultiAnim(MultiAnim other)
 {
     Frames = new List <MultiAnimFrame>();
     foreach (MultiAnimFrame frame in other.Frames)
     {
         Frames.Add(frame.Clone());
     }
 }
Example #3
0
        //creates a multianim for "live" use
        //TODO: find a better pattern for this
        public MultiAnim(MultiAnim other, float sizeRatio, Loc mapLoc, Dir8 dir, int locHeight, int cycles)
        {
            Frames = new List <MultiAnimFrame>();
            //clone all main attributes
            AnimSize = new Rect();
            foreach (MultiAnimFrame frame in other.Frames)
            {
                Frames.Add(frame.Clone());
                //calculate animSize
                AnimSize        = Rect.Union(AnimSize, frame.GetFrameRect());
                TotalFrameTime += frame.TotalTime;
            }
            //adopt sizeRatio
            SizeRatio = sizeRatio;

            this.mapLoc    = mapLoc;
            Direction      = dir;
            this.locHeight = locHeight;
            TotalTime      = TotalFrameTime * Math.Max(1, cycles);
        }
Example #4
0
 public ExpandableEmitter(MultiAnim anim)
 {
     Anim  = anim;
     Layer = DrawLayer.Normal;
 }
Example #5
0
 public ExpandableEmitter()
 {
     Anim  = new MultiAnim();
     Layer = DrawLayer.Normal;
 }