Ejemplo n.º 1
0
 public abstract Timeline Copy(AnimationClass.AnimationLayer ActiveLayer);
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 5
0
 protected override Timeline LoadCopy(BinaryReader BR, Microsoft.Xna.Framework.Content.ContentManager Content, AnimationClass.AnimationLayer ActiveLayer)
 {
     return(DoLoadCopy(BR, Content, ActiveLayer));
 }
Ejemplo n.º 6
0
 public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, Point MousePosition)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
        public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition)
        {
            List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>();

            return(ReturnValue);
        }
Ejemplo n.º 8
0
 private PolygonCutterKeyFrame(AnimationClass.AnimationLayer ActiveLayer)
 {
     this.ActiveLayer = ActiveLayer;
     ListPolygon      = new List <Polygon>();
 }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
            }
        }
Ejemplo n.º 11
0
 protected override VisibleTimeline DoLoadCopy(BinaryReader BR, Microsoft.Xna.Framework.Content.ContentManager Content, AnimationClass.AnimationLayer ActiveLayer)
 {
     return(new PolygonCutterTimeline(BR, ActiveLayer));
 }
Ejemplo n.º 12
0
            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);
            }
Ejemplo n.º 13
0
 public abstract List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, Point MousePosition);
Ejemplo n.º 14
0
 public abstract void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame);
Ejemplo n.º 15
0
 protected override Timeline LoadCopy(BinaryReader BR, ContentManager Content, AnimationClass.AnimationLayer ActiveLayer)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 16
0
 public PolygonCutterKeyFrame(AnimationClass.AnimationLayer ActiveLayer, Vector2 NextPosition, bool IsProgressive, int NextKeyFrame)
     : base(NextPosition, IsProgressive, NextKeyFrame)
 {
     this.ActiveLayer = ActiveLayer;
     ListPolygon      = new List <Polygon>();
 }
Ejemplo n.º 17
0
 public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 18
0
 public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame)
 {
     ActiveAnimation.OnPolygonCutterTimelineSpawn(ActiveLayer, this);
 }
Ejemplo n.º 19
0
 protected override VisibleTimeline DoLoadCopy(BinaryReader BR, ContentManager Content, AnimationClass.AnimationLayer ActiveLayer)
 {
     return(new BlankTimeline(SourceRectangle.X, SourceRectangle.Y, SourceRectangle.Width, SourceRectangle.Height));
 }
Ejemplo n.º 20
0
        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);
        }
Ejemplo n.º 22
0
        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);
        }
Ejemplo n.º 23
0
            public override AnimationObjectKeyFrame Copy(AnimationClass.AnimationLayer ActiveLayer)
            {
                BackgroundKeyFrame NewBackgroundKeyFrame = new BackgroundKeyFrame(this);

                return(NewBackgroundKeyFrame);
            }
Ejemplo n.º 24
0
            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);
            }
Ejemplo n.º 25
0
 protected abstract VisibleTimeline DoLoadCopy(BinaryReader BR, Microsoft.Xna.Framework.Content.ContentManager Content, AnimationClass.AnimationLayer ActiveLayer);
Ejemplo n.º 26
0
        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));
 }
Ejemplo n.º 28
0
        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);
            }
Ejemplo n.º 30
0
        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);
        }