public override Timeline Copy(AnimationClass.AnimationLayer ActiveLayer) { DamageBoxTimeline NewSetMarkerEvent = new DamageBoxTimeline(Owner); NewSetMarkerEvent.UpdateFrom(this, ActiveLayer); return(NewSetMarkerEvent); }
public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition) { List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>(); Vector2[] LocalPoints = new Vector2[4] { new Vector2(MousePosition.X - 40, MousePosition.Y - 40), new Vector2(MousePosition.X - 40, MousePosition.Y + 40), new Vector2(MousePosition.X + 40, MousePosition.Y + 40), new Vector2(MousePosition.X + 40, MousePosition.Y - 40), }; List <Polygon> ListPolygon = new List <Polygon>(); DamageBoxTimeline NewMeleeTimeline = new DamageBoxTimeline(); PolygonCutterHelper NewSpawner = new PolygonCutterHelper(ActiveLayer.renderTarget, ListPolygon, true); Polygon NewPolygon = new Polygon(LocalPoints, GameScreen.GraphicsDevice.Viewport.Width, GameScreen.GraphicsDevice.Viewport.Height); NewSpawner.PolygonCutterViewer.ListPolygon.Add(NewPolygon); if (NewSpawner.ShowDialog() == System.Windows.Forms.DialogResult.OK) { NewMeleeTimeline.SpawnFrame = KeyFrame; NewMeleeTimeline.DeathFrame = KeyFrame + 10; NewMeleeTimeline.IsUsed = true;//Disable the spawner as we spawn the Marker manually. Vector2[] NewArrayVertex = new Vector2[NewSpawner.PolygonCutterViewer.ListPolygon[0].ArrayVertex.Length]; Array.Copy(NewSpawner.PolygonCutterViewer.ListPolygon[0].ArrayVertex, NewArrayVertex, NewSpawner.PolygonCutterViewer.ListPolygon[0].ArrayVertex.Length); VisibleAnimationObjectKeyFrame NewPolygonCutterKeyFrame = new VisibleAnimationObjectKeyFrame(NewMeleeTimeline.Position, true, -1); Polygon NewKeyFramePolygon = new Polygon(NewArrayVertex, ActiveLayer.renderTarget.Width, ActiveLayer.renderTarget.Height); NewMeleeTimeline.Add(KeyFrame, NewPolygonCutterKeyFrame); NewMeleeTimeline.ListCollisionPolygon.Add(NewKeyFramePolygon); NewMeleeTimeline.ListOriginalPolygon.Add(new Polygon(NewKeyFramePolygon)); NewKeyFramePolygon.UpdateWorldPosition(Vector2.Zero, 0f); NewMeleeTimeline.ComputeSourceRectangle(); ReturnValue.Add(NewMeleeTimeline); } return(ReturnValue); }