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; }
protected MultiAnim(MultiAnim other) { Frames = new List <MultiAnimFrame>(); foreach (MultiAnimFrame frame in other.Frames) { Frames.Add(frame.Clone()); } }
//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); }
public ExpandableEmitter(MultiAnim anim) { Anim = anim; Layer = DrawLayer.Normal; }
public ExpandableEmitter() { Anim = new MultiAnim(); Layer = DrawLayer.Normal; }