public abstract Timeline Copy(AnimationClass.AnimationLayer ActiveLayer);
public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame) { EventKeyFrameOld = KeyFrame; ActiveAnimation.OnVisibleTimelineSpawn(ActiveLayer, this); }
public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition) { List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>(); AnimatedBitmapSpawnerHelper NewSpawner = new AnimatedBitmapSpawnerHelper(); if (NewSpawner.ShowDialog() == System.Windows.Forms.DialogResult.OK) { AnimatedTileTimeline NewAnimatedBitmapSpawner = new AnimatedTileTimeline(NewSpawner.SpawnViewer.BitmapName, NewSpawner.SpawnViewer.Bitmap); NewAnimatedBitmapSpawner.Position = new Vector2(535, 170); NewAnimatedBitmapSpawner.SpawnFrame = KeyFrame; NewAnimatedBitmapSpawner.DeathFrame = KeyFrame + 10; NewAnimatedBitmapSpawner.IsUsed = true;//Disable the spawner as we spawn the AnimatedBitmap manually. NewAnimatedBitmapSpawner.Add(KeyFrame, new AnimatedTileKeyFrame(NewAnimatedBitmapSpawner.Position, true, -1, NewAnimatedBitmapSpawner.PixelPerSecond, 312)); ReturnValue.Add(NewAnimatedBitmapSpawner); } return(ReturnValue); }
public void SetActiveLayer(AnimationClass.AnimationLayer ActiveLayer) { this.ActiveLayer = ActiveLayer; }
protected override Timeline LoadCopy(BinaryReader BR, Microsoft.Xna.Framework.Content.ContentManager Content, AnimationClass.AnimationLayer ActiveLayer) { return(DoLoadCopy(BR, Content, ActiveLayer)); }
public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, Point MousePosition) { throw new NotImplementedException(); }
public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition) { List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>(); return(ReturnValue); }
private PolygonCutterKeyFrame(AnimationClass.AnimationLayer ActiveLayer) { this.ActiveLayer = ActiveLayer; ListPolygon = new List <Polygon>(); }
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), }; PolygonCutterTimeline NewCreatePolygonCutterEvent = new PolygonCutterTimeline("New Polygon Cutter", Vector2.Zero, ActiveLayer); PolygonCutterHelper NewSpawner = new PolygonCutterHelper(ActiveLayer.renderTarget, NewCreatePolygonCutterEvent.ListPolygon, true); NewSpawner.PolygonCutterViewer.ListPolygon.Add(new Polygon(LocalPoints, GameScreen.GraphicsDevice.Viewport.Width, GameScreen.GraphicsDevice.Viewport.Height)); if (NewSpawner.ShowDialog() == System.Windows.Forms.DialogResult.OK) { NewCreatePolygonCutterEvent.SpawnFrame = KeyFrame; NewCreatePolygonCutterEvent.DeathFrame = KeyFrame + 10; NewCreatePolygonCutterEvent.IsUsed = true;//Disable the spawner as we spawn the timeline manually. PolygonCutterKeyFrame NewPolygonCutterKeyFrame = new PolygonCutterKeyFrame(ActiveLayer, NewCreatePolygonCutterEvent.Position, true, -1); foreach (Polygon NewPolygon in NewSpawner.PolygonCutterViewer.ListPolygon) { NewPolygonCutterKeyFrame.ListPolygon.Add(new Polygon(NewPolygon)); } NewCreatePolygonCutterEvent.ListPolygon.AddRange(NewSpawner.PolygonCutterViewer.ListPolygon); NewCreatePolygonCutterEvent.Add(KeyFrame, NewPolygonCutterKeyFrame); ReturnValue.Add(NewCreatePolygonCutterEvent); } return(ReturnValue); }
public PolygonCutterTimeline(BinaryReader BR, AnimationClass.AnimationLayer ActiveLayer) : base(BR, TimelineType) { this.ActiveLayer = ActiveLayer; _PolygonCutterType = (PolygonCutterTypes)BR.ReadByte(); _PolygonCutterSpecialEffect = (PolygonCutterSpecialEffects)BR.ReadByte(); ListPolygon = new List <Polygon>(); float MinX = float.MaxValue; float MaxX = float.MinValue; float MinY = float.MaxValue; float MaxY = float.MinValue; foreach (Polygon ActivePolygon in ListPolygon) { for (int V = 0; V < ActivePolygon.VertexCount; V++) { int VertexX = (int)ActivePolygon.ArrayVertex[V].X; int VertexY = (int)ActivePolygon.ArrayVertex[V].Y; if (VertexX < MinX) { MinX = VertexX; } if (VertexX > MaxX) { MaxX = VertexX; } if (VertexY < MinY) { MinY = VertexY; } if (VertexY > MaxY) { MaxY = VertexY; } } } SourceRectangle = new Rectangle((int)MinX, (int)MinY, (int)(MaxX - MinX), (int)(MaxY - MinY)); Origin = new Point(Width / 2, Height / 2); int DicAnimationSpriteKeyFrameCount = BR.ReadInt32(); for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++) { int Key = BR.ReadInt32(); PolygonCutterKeyFrame NewPolygonCutterKeyFrame = new PolygonCutterKeyFrame(BR, ActiveLayer); DicAnimationKeyFrame.Add(Key, NewPolygonCutterKeyFrame); } int FirstKey = int.MaxValue; foreach (int ActiveKey in DicAnimationKeyFrame.Keys) { if (FirstKey > ActiveKey) { FirstKey = ActiveKey; } } PolygonCutterKeyFrame FirstKeyFrame = (PolygonCutterKeyFrame)DicAnimationKeyFrame[FirstKey]; for (int P = 0; P < FirstKeyFrame.ListPolygon.Count; P++) { Polygon ActivePolygon = new Polygon(FirstKeyFrame.ListPolygon[P]); ListPolygon.Add(ActivePolygon); } }
protected override VisibleTimeline DoLoadCopy(BinaryReader BR, Microsoft.Xna.Framework.Content.ContentManager Content, AnimationClass.AnimationLayer ActiveLayer) { return(new PolygonCutterTimeline(BR, ActiveLayer)); }
protected override VisibleAnimationObjectKeyFrame CopyAsVisibleAnimationObjectKeyFrame(AnimationClass.AnimationLayer ActiveLayer) { PolygonCutterKeyFrame NewPolygonCutterKeyFrame = new PolygonCutterKeyFrame(ActiveLayer); NewPolygonCutterKeyFrame.UpdateFrom(this); NewPolygonCutterKeyFrame.ListPolygon = new List <Polygon>(ListPolygon.Count); foreach (Polygon ActivePolygon in ListPolygon) { NewPolygonCutterKeyFrame.ListPolygon.Add(new Polygon(ActivePolygon)); } return(NewPolygonCutterKeyFrame); }
public abstract List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, Point MousePosition);
public abstract void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame);
protected override Timeline LoadCopy(BinaryReader BR, ContentManager Content, AnimationClass.AnimationLayer ActiveLayer) { throw new NotImplementedException(); }
public PolygonCutterKeyFrame(AnimationClass.AnimationLayer ActiveLayer, Vector2 NextPosition, bool IsProgressive, int NextKeyFrame) : base(NextPosition, IsProgressive, NextKeyFrame) { this.ActiveLayer = ActiveLayer; ListPolygon = new List <Polygon>(); }
public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame) { throw new NotImplementedException(); }
public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame) { ActiveAnimation.OnPolygonCutterTimelineSpawn(ActiveLayer, this); }
protected override VisibleTimeline DoLoadCopy(BinaryReader BR, ContentManager Content, AnimationClass.AnimationLayer ActiveLayer) { return(new BlankTimeline(SourceRectangle.X, SourceRectangle.Y, SourceRectangle.Width, SourceRectangle.Height)); }
public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition) { List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>(); SpriteSheetHelperDialog.SpriteSheetViewer.DicActiveSpriteSheetBitmap.Clear(); if (SpriteSheetHelperDialog.ShowDialog() == DialogResult.OK && SpriteSheetHelperDialog.SpriteSheetViewer.DicActiveSpriteSheetBitmap.Count > 0) { foreach (KeyValuePair <Tuple <int, int>, SpriteSheetTimeline> ActiveBitmap in SpriteSheetHelperDialog.SpriteSheetViewer.DicActiveSpriteSheetBitmap) { SpriteSheetTimeline NewSpawnSpriteSheetBitmap = ActiveBitmap.Value; NewSpawnSpriteSheetBitmap.Position = new Vector2(535, 170); NewSpawnSpriteSheetBitmap.SpawnFrame = KeyFrame; NewSpawnSpriteSheetBitmap.DeathFrame = KeyFrame + 10; NewSpawnSpriteSheetBitmap.IsUsed = true;//Disable the spawner as we spawn the SpawnSpriteSheetBitmap manually. NewSpawnSpriteSheetBitmap.Add( KeyFrame, new VisibleAnimationObjectKeyFrame(new Vector2(NewSpawnSpriteSheetBitmap.Position.X, NewSpawnSpriteSheetBitmap.Position.Y), true, -1)); ReturnValue.Add(NewSpawnSpriteSheetBitmap); } } return(ReturnValue); }
public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition) { List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>(); SpriteSheetHelperDialog.SpriteSheetViewer.DicActiveSpriteSheetBitmap.Clear(); if (SpriteSheetHelperDialog.ShowDialog() == DialogResult.OK && SpriteSheetHelperDialog.SpriteSheetViewer.DicActiveSpriteSheetBitmap.Count > 0) { int Index = 1; foreach (KeyValuePair <Tuple <int, int>, SpriteSheetTimeline> ActiveBitmap in SpriteSheetHelperDialog.SpriteSheetViewer.DicActiveSpriteSheetBitmap) { SpriteSheetTimeline NewSpawnSpriteSheetBitmap = ActiveBitmap.Value; string[] ArraySpriteSheetName = NewSpawnSpriteSheetBitmap.SpriteSheetName.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries); NewSpawnSpriteSheetBitmap.Name = ArraySpriteSheetName[ArraySpriteSheetName.Length - 1]; if (SpriteSheetHelperDialog.SpriteSheetViewer.DicActiveSpriteSheetBitmap.Count > 1) { NewSpawnSpriteSheetBitmap.Name += " " + Index; } NewSpawnSpriteSheetBitmap.Position = new Vector2(535, 170); NewSpawnSpriteSheetBitmap.SpawnFrame = KeyFrame; NewSpawnSpriteSheetBitmap.DeathFrame = KeyFrame + 10; NewSpawnSpriteSheetBitmap.IsUsed = true;//Disable the spawner as we spawn the SpawnSpriteSheetBitmap manually. NewSpawnSpriteSheetBitmap.Add( KeyFrame, new VisibleAnimationObjectKeyFrame(new Vector2(NewSpawnSpriteSheetBitmap.Position.X, NewSpawnSpriteSheetBitmap.Position.Y), true, -1)); ReturnValue.Add(NewSpawnSpriteSheetBitmap); ++Index; } } return(ReturnValue); }
public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition) { List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>(); AnimatedChainSpawnerHelper NewSpawner = new AnimatedChainSpawnerHelper(); if (NewSpawner.ShowDialog() == System.Windows.Forms.DialogResult.OK) { AnimatedChainTimeline NewAnimatedBitmapSpawner = new AnimatedChainTimeline(NewSpawner.ChainLinkViewer.content, NewSpawner.ChainLinkPath, new Vector2((float)NewSpawner.txtChainLinkOriginX.Value, (float)NewSpawner.txtChainLinkOriginY.Value), NewSpawner.ChainEndPath, new Vector2((float)NewSpawner.txtChainEndOriginX.Value, (float)NewSpawner.txtChainEndOriginY.Value), NewSpawner.ChainStartPath, new Vector2((float)NewSpawner.txtChainStartOriginX.Value, (float)NewSpawner.txtChainStartOriginY.Value)); NewAnimatedBitmapSpawner.Position = new Vector2(535, 170); NewAnimatedBitmapSpawner.SpawnFrame = KeyFrame; NewAnimatedBitmapSpawner.DeathFrame = KeyFrame + 10; NewAnimatedBitmapSpawner.IsUsed = true;//Disable the spawner as we spawn the AnimatedBitmap manually. NewAnimatedBitmapSpawner.Add(KeyFrame, new AnimatedChainKeyFrame(NewAnimatedBitmapSpawner.Position, true, -1, 50)); ReturnValue.Add(NewAnimatedBitmapSpawner); } return(ReturnValue); }
public override AnimationObjectKeyFrame Copy(AnimationClass.AnimationLayer ActiveLayer) { BackgroundKeyFrame NewBackgroundKeyFrame = new BackgroundKeyFrame(this); return(NewBackgroundKeyFrame); }
protected override VisibleAnimationObjectKeyFrame CopyAsVisibleAnimationObjectKeyFrame(AnimationClass.AnimationLayer ActiveLayer) { AnimatedChainKeyFrame NewAnimatedBitmapKeyFrame = new AnimatedChainKeyFrame(); NewAnimatedBitmapKeyFrame.UpdateFrom(this); NewAnimatedBitmapKeyFrame._ChainLengthInPixel = _ChainLengthInPixel; NewAnimatedBitmapKeyFrame.ListChainSplinePoints = new List <Vector2>(ListChainSplinePoints); return(NewAnimatedBitmapKeyFrame); }
protected abstract VisibleTimeline DoLoadCopy(BinaryReader BR, Microsoft.Xna.Framework.Content.ContentManager Content, AnimationClass.AnimationLayer ActiveLayer);
public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition) { List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>(); AnimatedBitmapSpawnerHelper NewSpawner = new AnimatedBitmapSpawnerHelper(); if (NewSpawner.ShowDialog() == DialogResult.OK) { string SpriteName = "Animations/Sprites/" + NewSpawner.SpawnViewer.BitmapName; Matrix view = Matrix.Identity; Matrix Projection = Matrix.CreateOrthographicOffCenter(0, ActiveLayer.renderTarget.Width, ActiveLayer.renderTarget.Height, 0, 0, 1); Matrix HalfPixelOffset = Matrix.CreateTranslation(-0.5f, -0.5f, 0); Projection = view * (HalfPixelOffset * Projection); Particle3DSample.ParticleSettings ParticleSettings = new Particle3DSample.ParticleSettings(); ParticleSettings.TextureName = SpriteName; ParticleSettings.MaxParticles = 20000; ParticleSettings.MinScale = new Vector2(1, 1); ParticleSettings.DurationInSeconds = 1d; ParticleSettings.Gravity = new Vector2(0, 0); ParticleSettings.NumberOfImages = 1; ParticleSettings.BlendState = BlendState.AlphaBlend; ParticleSettings.StartingAlpha = 0.7f; ParticleSettings.EndAlpha = 0.1f; int StripIndex = SpriteName.IndexOf("_strip"); if (StripIndex > 0) { StripIndex += 6; string ImageInformation = SpriteName.Substring(StripIndex); ParticleSettings.NumberOfImages = Convert.ToInt32(ImageInformation); } ParticleSystem = new Particle3DSample.ParticleSystem(ParticleSettings); ParticleSystem.LoadContent(NewSpawner.SpawnViewer.content, GameScreen.GraphicsDevice, Projection); ParticleEmitterTimeline NewParticleEmitorTimeline = new ParticleEmitterTimeline(ParticleSystem); NewParticleEmitorTimeline.Position = new Vector2(535, 170); NewParticleEmitorTimeline.SpawnFrame = KeyFrame; NewParticleEmitorTimeline.DeathFrame = KeyFrame + 10; NewParticleEmitorTimeline.IsUsed = true;//Disable the spawner as we spawn the AnimatedBitmap manually. NewParticleEmitorTimeline.Add( KeyFrame, new VisibleAnimationObjectKeyFrame(new Vector2(NewParticleEmitorTimeline.Position.X, NewParticleEmitorTimeline.Position.Y), true, -1)); ReturnValue.Add(NewParticleEmitorTimeline); } return(ReturnValue); }
protected override VisibleTimeline DoLoadCopy(BinaryReader BR, ContentManager Content, AnimationClass.AnimationLayer ActiveLayer) { return(new AnimatedTileTimeline(BR, Content)); }
public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame) { base.SpawnItem(ActiveAnimation, ActiveLayer, KeyFrame); ParticleSystem.ClearParticles(); }
protected override VisibleAnimationObjectKeyFrame CopyAsVisibleAnimationObjectKeyFrame(AnimationClass.AnimationLayer ActiveLayer) { AnimatedTileKeyFrame NewAnimatedBitmapKeyFrame = new AnimatedTileKeyFrame(); NewAnimatedBitmapKeyFrame.UpdateFrom(this); NewAnimatedBitmapKeyFrame._PixelPerSecond = _PixelPerSecond; NewAnimatedBitmapKeyFrame._MaxWidth = _MaxWidth; return(NewAnimatedBitmapKeyFrame); }
public static Timeline Load(BinaryReader BR, Microsoft.Xna.Framework.Content.ContentManager Content, AnimationClass.AnimationLayer ActiveLayer, Dictionary <string, Timeline> DicTimeline) { string TimelineEventType = BR.ReadString(); Timeline NewTimeline = DicTimeline[TimelineEventType].LoadCopy(BR, Content, ActiveLayer); return(NewTimeline); }