Beispiel #1
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);
        }
        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);
        }
Beispiel #3
0
        public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame)
        {
            Quote ActiveQuoteSetFrame = ((QuoteSetKeyFrame)DicAnimationKeyFrame[KeyFrame]).QuoteSet;

            ActiveAnimation.ActiveQuoteSet  = ActiveQuoteSetFrame.ActiveText;
            ActiveAnimation.ActiveCharacter = ActiveQuoteSetFrame.ActiveCharacter;
        }
Beispiel #4
0
        public void Load(ContentManager Content, string TexturePathPrefix)
        {
            if (IsAnimated)
            {
                ActiveAnimation         = new AnimationLooped(Path);
                ActiveAnimation.Content = Content;
                foreach (KeyValuePair <string, Timeline> Timeline in AnimationClass.LoadAllTimelines())
                {
                    ActiveAnimation.DicTimeline.Add(Timeline.Key, Timeline.Value);
                }
                ActiveAnimation.Load();
            }
            else
            {
                if (Path.Contains("strip"))
                {
                    ActualSprite = new AnimatedSprite(Content, "Animations/Sprites/" + Path, Vector2.Zero);
                }
                else
                {
                    StaticSprite = Content.Load <Texture2D>(TexturePathPrefix + Path);
                }
            }

            Rectangle Size = PositionRectangle;

            Origin = new Vector2(Size.Width / 2, Size.Height / 2);
        }
Beispiel #5
0
        public SimpleAnimation(BinaryReader BR, ContentManager Content, string TexturePathPrefix)
            : this()
        {
            IsAnimated = BR.ReadBoolean();
            Name       = BR.ReadString();
            Path       = BR.ReadString();

            if (IsAnimated)
            {
                ActiveAnimation         = new AnimationLooped(Path);
                ActiveAnimation.Content = Content;
                foreach (KeyValuePair <string, Timeline> Timeline in AnimationClass.LoadAllTimelines())
                {
                    ActiveAnimation.DicTimeline.Add(Timeline.Key, Timeline.Value);
                }
                ActiveAnimation.Load();
            }
            else
            {
                if (Path.Contains("strip"))
                {
                    ActualSprite = new AnimatedSprite(Content, Path, Vector2.Zero);
                }
                else
                {
                    StaticSprite = Content.Load <Texture2D>(TexturePathPrefix + Path);
                }

                Rectangle Size = PositionRectangle;
                Origin = new Vector2(Size.Width / 2, Size.Height / 2);
            }
        }
Beispiel #6
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 static GameEngineLayer EmptyGameEngineLayer(AnimationClass Owner)
            {
                GameEngineLayer NewGameEngineLayer = new GameEngineLayer();

                NewGameEngineLayer.Owner = Owner;
                return(NewGameEngineLayer);
            }
        public virtual AnimationClass Copy()
        {
            AnimationClass NewAnimationClass = new AnimationClass();

            NewAnimationClass.UpdateFrom(this);

            return(NewAnimationClass);
        }
Beispiel #9
0
        public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame)
        {
            BackgroundKeyFrame ActiveBackgroundKeyFrame = (BackgroundKeyFrame)DicAnimationKeyFrame[KeyFrame];

            if (ActiveAnimation.ActiveAnimationBackground != null)
            {
                ActiveAnimation.ActiveAnimationBackground.MoveSpeed = new Vector3(ActiveBackgroundKeyFrame.SpeedX, ActiveBackgroundKeyFrame.SpeedY, ActiveBackgroundKeyFrame.SpeedZ);
            }
        }
Beispiel #10
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);
        }
        public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame)
        {
            SFX ActiveSetSFX = ((SFXKeyFrame)DicAnimationKeyFrame[KeyFrame]).SFX;

            if (string.IsNullOrEmpty(ActiveSetSFX.SFXPath))
            {
                return;
            }

            ActiveSetSFX.SFXSound = new FMODSound(GameScreen.FMODSystem, "Content/SFX/" + ActiveSetSFX.SFXPath);
            ActiveSetSFX.SFXSound.SetLoop(ActiveSetSFX.Loop);
            ActiveSetSFX.SFXSound.Play(ActiveSetSFX.Volume);
            ActiveSetSFX.DeathFrame = KeyFrame + ActiveSetSFX.Length;
            ActiveAnimation.ListActiveSFX.Add(ActiveSetSFX);
        }
        protected void UpdateFrom(AnimationClass Other)
        {
            sprTopLeftAttack  = Other.sprTopLeftAttack;
            sprTopLeftCounter = Other.sprTopLeftCounter;
            sprTopLeftDefense = Other.sprTopLeftDefense;
            sprTopLeftEvasion = Other.sprTopLeftEvasion;

            ListAnimationLayer = Other.ListAnimationLayer.Copy();
            AnimationPath      = Other.AnimationPath;
            ScreenWidth        = Other.ScreenWidth;
            ScreenHeight       = Other.ScreenHeight;
            LoopStart          = Other.LoopStart;
            LoopEnd            = Other.LoopEnd;
            PolygonEffect      = Other.PolygonEffect;
        }
 public AnimationLayer(AnimationClass Owner, string Name)
 {
     this.Name           = Name;
     this.Owner          = Owner;
     ListChildren        = new List <AnimationLayer>();
     DicTimelineEvent    = new Dictionary <int, List <Timeline> >();
     ListVisibleObject   = new List <VisibleTimeline>();
     ListActiveMarker    = new List <MarkerTimeline>();
     ListPolygonCutter   = new List <PolygonCutterTimeline>();
     DicGroupEvent       = new Dictionary <uint, GroupTimeline>();
     _LayerBlendState    = LayerBlendStates.Add;
     _LayerSamplerStates = LayerSamplerStates.LinearClamp;
     SamplerState        = SamplerState.LinearClamp;
     ShowChildren        = true;
     IsVisible           = true;
     IsLocked            = false;
     IsSelected          = false;
 }
            protected void UpdateFrom(AnimationLayer Other)
            {
                _Name = Other._Name;
                Owner = Other.Owner;

                ListChildren = new List <AnimationLayer>(Other.ListChildren.Count);
                foreach (AnimationLayer ActiveLayer in Other.ListChildren)
                {
                    ListChildren.Add(ActiveLayer.Copy());
                }

                DicTimelineEvent = new Dictionary <int, List <Timeline> >(Other.DicTimelineEvent.Count);
                foreach (KeyValuePair <int, List <Timeline> > ActiveListTimelineEvent in Other.DicTimelineEvent)
                {
                    List <Timeline> ListTimelineEvent = new List <Timeline>(ActiveListTimelineEvent.Value.Count);

                    foreach (Timeline ActiveTimelineEvent in ActiveListTimelineEvent.Value)
                    {
                        ListTimelineEvent.Add(ActiveTimelineEvent.Copy(this));
                    }

                    DicTimelineEvent.Add(ActiveListTimelineEvent.Key, ListTimelineEvent);
                }
                DicGroupEvent = new Dictionary <uint, GroupTimeline>(Other.DicGroupEvent.Count);
                foreach (KeyValuePair <uint, GroupTimeline> ActiveGroupEvent in Other.DicGroupEvent)
                {
                    DicGroupEvent.Add(ActiveGroupEvent.Key, (GroupTimeline)ActiveGroupEvent.Value.Copy(this));
                }

                ListVisibleObject = new List <VisibleTimeline>();
                ListActiveMarker  = new List <MarkerTimeline>();
                ListPolygonCutter = new List <PolygonCutterTimeline>();
                renderTarget      = Other.renderTarget;

                _LayerBlendState = Other._LayerBlendState;
                _Alpha           = Other._Alpha;
                ShowChildren     = Other.ShowChildren;
                IsSelected       = Other.IsSelected;
                IsVisible        = Other.IsVisible;
                IsLocked         = Other.IsLocked;
            }
Beispiel #15
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);
        }
        public override void OnAnimationEditorLoad(AnimationClass ActiveAnimation)
        {
            SpriteSheetHelperDialog = new SpriteSheetHelper();
            SpriteSheetHelperDialog.SpriteSheetViewer.Preload();
            SpriteSheetHelperDialog.SpriteSheetViewer.DicSpriteSheet = new Dictionary <string, Texture2D>();
            if (SpriteSheetName != null)
            {
                ListViewItem NewListViewItem = new ListViewItem(SpriteSheetName);
                NewListViewItem.Tag = SpriteSheet;

                SpriteSheetHelperDialog.lvSpriteSheets.Items.Add(NewListViewItem);
                SpriteSheetHelperDialog.SpriteSheetViewer.DicSpriteSheet.Add(SpriteSheetName, SpriteSheet);
            }
            else
            {
                for (int L = ActiveAnimation.ListAnimationLayer.Count - 1; L >= 0; --L)
                {
                    foreach (KeyValuePair <int, List <Timeline> > ActiveEvent in ActiveAnimation.ListAnimationLayer[L].DicTimelineEvent)
                    {
                        for (int E = ActiveEvent.Value.Count - 1; E >= 0; --E)
                        {
                            SpriteSheetTimeline ActiveTimeline = ActiveEvent.Value[E] as SpriteSheetTimeline;

                            if (ActiveTimeline != null)
                            {
                                if (!SpriteSheetHelperDialog.SpriteSheetViewer.DicSpriteSheet.ContainsKey(ActiveTimeline.SpriteSheetName))
                                {
                                    ListViewItem NewListViewItem = new ListViewItem(ActiveTimeline.SpriteSheetName);
                                    NewListViewItem.Tag = ActiveTimeline.SpriteSheet;

                                    SpriteSheetHelperDialog.lvSpriteSheets.Items.Add(NewListViewItem);
                                    SpriteSheetHelperDialog.SpriteSheetViewer.DicSpriteSheet.Add(ActiveTimeline.SpriteSheetName, ActiveTimeline.SpriteSheet);
                                }
                            }
                        }
                    }
                }
            }
        }
        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 override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition)
        {
            List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>();

            MarkerHelper NewSpawner = new MarkerHelper();

            if (NewSpawner.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                MarkerTimeline NewSetMarkerEvent = NewSpawner.MarkerViewer.ActiveMarker;

                NewSetMarkerEvent.Position   = new Vector2(535, 170);
                NewSetMarkerEvent.SpawnFrame = KeyFrame;
                NewSetMarkerEvent.DeathFrame = KeyFrame + 10;
                NewSetMarkerEvent.IsUsed     = true;//Disable the spawner as we spawn the Marker manually.
                NewSetMarkerEvent.Add(KeyFrame,
                                      new VisibleAnimationObjectKeyFrame(new Vector2(NewSpawner.MarkerViewer.ActiveMarker.Position.X, NewSpawner.MarkerViewer.ActiveMarker.Position.Y),
                                                                         true, -1));

                ReturnValue.Add(NewSetMarkerEvent);
            }

            return(ReturnValue);
        }
        protected AnimationClass CreateAnimation(string AnimationName, bool IsPartialAnimation)
        {
            AnimationClass ActiveAnimation = null;

            if (IsPartialAnimation)
            {
                ActiveAnimation = new PartialAnimation(AnimationName, this);
            }
            else
            {
                ActiveAnimation = new AnimationClass(AnimationName);
            }

            ActiveAnimation.DicTimeline = DicTimeline;
            ActiveAnimation.LoadFromFile();

            for (int A = ActiveAnimation.ListAnimationLayer.Count - 1; A >= 0; --A)
            {
                ActiveAnimation.ListAnimationLayer[A].Owner = this;
            }

            return(ActiveAnimation);
        }
 public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition)
 {
     throw new NotImplementedException();
 }
        public void DrawLayer(CustomSpriteBatch g, AnimationLayer ActiveLayer, bool DrawMarker, AnimationLayer Parent, bool DrawChild = true)
        {
            if (DrawChild)
            {
                //TODO: Don't use Begin to use the transformationMatrix as it force the rendering making it impossible to properly use the drawing depth.
                if (ActiveLayer.LayerBlendState == AnimationLayer.LayerBlendStates.Add)
                {
                    g.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, ActiveLayer.SamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, TransformationMatrix);
                }
                else if (ActiveLayer.LayerBlendState == AnimationLayer.LayerBlendStates.Substract)
                {
                    g.Begin(SpriteSortMode.BackToFront, NegativeBlendState, ActiveLayer.SamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, TransformationMatrix);
                }
                else
                {
                    GraphicsDevice.Clear(ClearOptions.Stencil, Color.Black, 0, 0);
                    g.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, AlwaysStencilState, null, null);
                    DrawLayer(g, Parent, false, null, false);

                    g.Begin(SpriteSortMode.Immediate, null, SamplerState.PointClamp, EqualStencilState, null, null);
                    for (int A = 0; A < ActiveLayer.ListVisibleObject.Count; A++)
                    {
                        ActiveLayer.ListVisibleObject[A].Draw(g, false);
                    }
                }
            }

            for (int A = 0; A < ActiveLayer.ListVisibleObject.Count; A++)
            {
                ActiveLayer.ListVisibleObject[A].Draw(g, false);
            }

            if (DrawMarker)
            {
                for (int M = 0; M < ActiveLayer.ListActiveMarker.Count; M++)
                {
                    AnimationClass          ActiveMarkerAnimation = ActiveLayer.ListActiveMarker[M].AnimationMarker;
                    AnimationOriginTimeline ActiveMarkerOrigin    = ActiveMarkerAnimation.AnimationOrigin;

                    for (int L = 0; L < ActiveMarkerAnimation.ListAnimationLayer.BasicLayerCount; L++)
                    {
                        SpriteEffects ActiveEffect = SpriteEffects.None;
                        if (ActiveLayer.ListActiveMarker[M].ScaleFactor.X < 0)
                        {
                            ActiveEffect = SpriteEffects.FlipHorizontally;
                        }
                        if (ActiveLayer.ListActiveMarker[M].ScaleFactor.Y < 0)
                        {
                            ActiveEffect |= SpriteEffects.FlipVertically;
                        }

                        int OriginX = (int)ActiveMarkerOrigin.Position.X;
                        if ((ActiveEffect & SpriteEffects.FlipHorizontally) == SpriteEffects.FlipHorizontally)
                        {
                            OriginX = Constants.Width - (int)ActiveMarkerOrigin.Position.X;
                        }

                        g.Draw(ActiveMarkerAnimation.ListAnimationLayer[ActiveMarkerAnimation.ListAnimationLayer.BasicLayerCount - L - 1].renderTarget,
                               new Vector2(ActiveLayer.ListActiveMarker[M].Position.X, ActiveLayer.ListActiveMarker[M].Position.Y), null, Color.White, 0,
                               new Vector2(OriginX, ActiveMarkerOrigin.Position.Y),
                               new Vector2(Math.Abs(ActiveLayer.ListActiveMarker[M].ScaleFactor.X), Math.Abs(ActiveLayer.ListActiveMarker[M].ScaleFactor.Y)), ActiveEffect, ActiveLayer.ListActiveMarker[M].DrawingDepth);
                    }
                }
            }
            g.End();

            if (DrawChild)
            {
                for (int L = 0; L < ActiveLayer.ListChildren.Count; L++)
                {
                    DrawLayer(g, ActiveLayer.ListChildren[L], DrawMarker, ActiveLayer, true);
                }
            }
        }
Beispiel #22
0
 public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame)
 {
     ActiveAnimation.OnPolygonCutterTimelineSpawn(ActiveLayer, this);
 }
Beispiel #23
0
 public abstract List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, Point MousePosition);
 public GameEngineLayer(AnimationClass Owner)
     : base(Owner, "Game Engine")
 {
 }
Beispiel #25
0
 public override void OnDeathFrame(AnimationClass ActiveAnimation)
 {
     ActiveAnimation.OnPolygonCutterTimelineDeath(this);
 }
Beispiel #26
0
        public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame)
        {
            base.SpawnItem(ActiveAnimation, ActiveLayer, KeyFrame);

            ParticleSystem.ClearParticles();
        }
 public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame)
 {
     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);
        }
Beispiel #29
0
 public virtual void OnDeathFrame(AnimationClass ActiveAnimation)
 {
     ActiveAnimation.OnVisibleTimelineDeath(this);
 }
Beispiel #30
0
 public override void SpawnItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame)
 {
     EventKeyFrameOld = KeyFrame;
     ActiveAnimation.OnVisibleTimelineSpawn(ActiveLayer, this);
 }