Exemple #1
0
        protected void UpdateFrom(VisibleTimeline Other, AnimationClass.AnimationLayer ActiveLayer)
        {
            base.UpdateFrom(Other, ActiveLayer);

            NextEventKeyFrame = Other.NextEventKeyFrame;
            if (NextEventKeyFrame >= 0 && Other.Count > 0)
            {
                NextEvent = DicAnimationKeyFrame[NextEventKeyFrame];
            }
            else
            {
                NextEvent = null;
            }

            _Position        = Other._Position;
            PositionOld      = Other.PositionOld;
            EventKeyFrameOld = Other.EventKeyFrameOld;
            Origin           = Other.Origin;
            SpawnFrame       = Other.SpawnFrame;
            DeathFrame       = Other.DeathFrame;
            DrawingDepth     = Other.DrawingDepth;
            DrawingDepthOld  = Other.DrawingDepthOld;

            ScaleFactor    = Other.ScaleFactor;
            ScaleFactorOld = Other.ScaleFactorOld;
            Angle          = Other.Angle;
            AngleOld       = Other.AngleOld;
            Alpha          = Other.Alpha;
            AlphaOld       = Other.AlphaOld;
        }
        public override void OnVisibleTimelineDeath(VisibleTimeline RemovedBitmap)
        {
            base.OnVisibleTimelineDeath(RemovedBitmap);

            if (DicActiveAnimationObject.ContainsKey(RemovedBitmap.Name))
            {
                DicActiveAnimationObject[RemovedBitmap.Name] = null;
            }
        }
        public override void OnVisibleTimelineDeath(VisibleTimeline RemovedBitmap)
        {
            base.OnVisibleTimelineDeath(RemovedBitmap);

            if (DicInheritedObject.ContainsKey(RemovedBitmap.Name))
            {
                DicInheritedObject[RemovedBitmap.Name] = null;
            }
        }
        public void OnKeyFrameChange(int NewKeyFrame)
        {
            //Clear the active view and reload everyhing up to NewKeyFrame
            if (NewKeyFrame < ActiveKeyFrame)
            {
                ActiveAnimation.CurrentQuote = "";
                ActiveAnimation.ListActiveSFX.Clear();
                ActiveKeyFrame = NewKeyFrame;

                if (ActiveAnimation.ActiveAnimationBackground != null)
                {
                    ActiveAnimation.ActiveAnimationBackground.ResetCamera();
                }

                for (int L = 0; L < ActiveAnimation.ListAnimationLayer.Count; L++)
                {
                    ActiveAnimation.ListAnimationLayer[L].ResetAnimationLayer();
                }

                for (int i = 0; i <= NewKeyFrame; i++)
                {
                    if (GameScreen.FMODSystem != null)
                    {
                        GameScreen.FMODSystem.System.update();
                    }

                    ActiveAnimation.UpdateKeyFrame(i);
                }
            }
            else
            {
                for (int i = ActiveKeyFrame; i <= NewKeyFrame; i++)
                {
                    if (GameScreen.FMODSystem != null)
                    {
                        GameScreen.FMODSystem.System.update();
                    }

                    ActiveAnimation.UpdateKeyFrame(i);
                }
            }
            ActiveKeyFrame = NewKeyFrame;
            // Removed selected objects that are not visible in the current key frame. (Because they were selected from the timline)
            for (int A = ActiveAnimation.ListSelectedObjects.Count - 1; A >= 0; --A)
            {
                VisibleTimeline SelectedVisibleTimeline = ActiveAnimation.ListSelectedObjects[A] as VisibleTimeline;
                if (SelectedVisibleTimeline != null && !ActiveLayer.ListVisibleObject.Contains(SelectedVisibleTimeline))
                {
                    ActiveAnimation.ListSelectedObjects.Remove(SelectedVisibleTimeline);
                    ActiveAnimation.MultipleSelectionRectangle = Microsoft.Xna.Framework.Rectangle.Empty;
                }
            }
        }
        public override void OnVisibleTimelineSpawn(AnimationLayer ActiveLayer, VisibleTimeline ActiveBitmap)
        {
            base.OnVisibleTimelineSpawn(ActiveLayer, ActiveBitmap);

            if (DicActiveAnimationObject.ContainsKey(ActiveBitmap.Name))
            {
                DicActiveAnimationObject[ActiveBitmap.Name] = ActiveBitmap;
            }
            else
            {
                DicActiveAnimationObject.Add(ActiveBitmap.Name, ActiveBitmap);
            }
        }
        public void CreateMultipleSelectionRectangle()
        {
            int MinX = 999999, MinY = 999999, MaxX = 0, MaxY = 0;

            foreach (Timeline ActiveObject in ListSelectedObjects)
            {
                VisibleTimeline ActiveVisibleTimeline = ActiveObject as VisibleTimeline;
                if (ActiveVisibleTimeline == null)
                {
                    continue;
                }

                int ObjectMinX;
                int ObjectMinY;
                int ObjectMaxX;
                int ObjectMaxY;
                ActiveVisibleTimeline.GetMinMax(out ObjectMinX, out ObjectMinY, out ObjectMaxX, out ObjectMaxY);

                if (ObjectMinX == ObjectMaxX || ObjectMinY == ObjectMaxY)
                {
                    continue;
                }

                if (ObjectMinX < MinX)
                {
                    MinX = ObjectMinX;
                }
                if (ObjectMaxX > MaxX)
                {
                    MaxX = ObjectMaxX;
                }

                if (ObjectMinY < MinY)
                {
                    MinY = ObjectMinY;
                }
                if (ObjectMaxY > MaxY)
                {
                    MaxY = ObjectMaxY;
                }
            }

            MultipleSelectionRectangle.X      = MinX;
            MultipleSelectionRectangle.Y      = MinY;
            MultipleSelectionRectangle.Width  = MaxX - MinX;
            MultipleSelectionRectangle.Height = MaxY - MinY;
            MultipleSelectionOrigin.X         = MultipleSelectionRectangle.Width / 2;
            MultipleSelectionOrigin.Y         = MultipleSelectionRectangle.Height / 2;
        }
 public virtual void OnVisibleTimelineDeath(VisibleTimeline RemovedBitmap)
 {
 }
 //The methods starting with "On" should only be called directly by the Timelines
 public virtual void OnVisibleTimelineSpawn(AnimationLayer ActiveLayer, VisibleTimeline ActiveTimeline)
 {
     ActiveLayer.ListVisibleObject.Add(ActiveTimeline);
 }