Ejemplo n.º 1
0
        /// <summary>
        /// Recursively create keyframes
        /// </summary>
        /// <param name="animation"></param>
        /// <param name="control"></param>
        private void CreateKeyframes(GUIAnimation animation, GUIControl control)
        {
            animation.CreateKeyFrame(control, 0);

            foreach (GUIControl child in control.Controls)
                CreateKeyframes(animation, child);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="frames"></param>
 /// <param name="animation"></param>
 public ClearFramesCommand(GUIAnimation animation, GUIAnimationChannel animationChannel, int start, int end)
 {
     mAnimation = animation;
     mAnimationChannel = animationChannel;
     mStart = start;
     mEnd = end;
     mKeyFrames = new List<KeyFrame>();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="trimStart"></param>
        /// <param name="trimEnd"></param>
        /// <param name="channel"></param>
        public TrimFramesCommand(int trimStart, int trimEnd, GUIAnimation animation)
        {
            mAnimation = animation;
            mTrimStart = trimStart;
            mTrimEnd = trimEnd;

            mOrigRepeatStart = animation.RepeatStart;
            mOrigRepeatEnd = animation.RepeatEnd;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor
        /// </summary>
        public GUIView(string name)
        {
            Name = name;
            Controls.OnControlAdded += new GUIControlCollection.ControlEventHandler(Controls_OnControlAdded);
            Controls.OnControlRemoved += new GUIControlCollection.ControlEventHandler(Controls_OnControlRemoved);

            GUIAnimation onActivate = new Otter.UI.Animation.GUIAnimation("OnActivate", true);
            GUIAnimation onDeactivate = new Otter.UI.Animation.GUIAnimation("OnDeactivate", true);
            onDeactivate.NumFrames = 1;

            Animations.Add(onActivate);
            Animations.Add(onDeactivate);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Constructor
        /// </summary>
        public GUIView(string name)
        {
            Name = name;
            Controls.OnControlAdded   += new GUIControlCollection.ControlEventHandler(Controls_OnControlAdded);
            Controls.OnControlRemoved += new GUIControlCollection.ControlEventHandler(Controls_OnControlRemoved);

            GUIAnimation onActivate   = new Otter.UI.Animation.GUIAnimation("OnActivate", true);
            GUIAnimation onDeactivate = new Otter.UI.Animation.GUIAnimation("OnDeactivate", true);

            onDeactivate.NumFrames = 1;

            Animations.Add(onActivate);
            Animations.Add(onDeactivate);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Clones this animation
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            GUIAnimation anim = new GUIAnimation();

            anim.mName      = this.Name;
            anim.mNumFrames = this.mNumFrames;
            anim.mFrame     = this.mFrame;
            anim.mRequired  = this.mRequired;

            anim.mRepeatStart = this.mRepeatStart;
            anim.mRepeatEnd   = this.mRepeatEnd;

            foreach (GUIAnimationChannel channel in this.mAnimationChannels)
            {
                anim.mAnimationChannels.Add((GUIAnimationChannel)channel.Clone());
            }

            foreach (MainChannelFrame frame in this.mMainChannelFrames)
            {
                anim.mMainChannelFrames.Add((MainChannelFrame)frame.Clone());
            }

            return(anim);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Called when an channel set has been removed from the sceneView
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="set"></param>
 private void View_AnimationRemoved(object sender, GUIAnimation animation)
 {
     mAnimationsToolStripComboBox.Items.Remove(animation);
     this.Invalidate(true);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Called when an channel set has been added to the sceneView
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="set"></param>
 private void View_AnimationAdded(object sender, GUIAnimation animation)
 {
     mAnimationsToolStripComboBox.Items.Insert(mAnimationsToolStripComboBox.Items.Count - 1, animation);
     this.Invalidate(true);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="trimStart"></param>
 /// <param name="trimEnd"></param>
 /// <param name="channel"></param>
 public InsertFramesCommand(int position, int count, GUIAnimation animation)
 {
     mAnimation = animation;
     mPosition = position;
     mCount = count;
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Removes an item from a channel
        /// </summary>
        /// <param name="channel"></param>
        /// <returns></returns>
        public bool Remove(GUIAnimation animation)
        {
            bool bSuccess = mAnimations.Remove(animation);

            return(bSuccess);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Returns the index of the channel in the collection.  Returns -1 if
 /// not present
 /// </summary>
 /// <param name="channel"></param>
 /// <returns></returns>
 public int IndexOf(GUIAnimation animation)
 {
     return(mAnimations.IndexOf(animation));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Returns whether or not we contain a specified channel
 /// </summary>
 /// <param name="channel"></param>
 /// <returns></returns>
 public bool Contains(GUIAnimation animation)
 {
     return(mAnimations.Contains(animation));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Adds an channel to this group
 /// </summary>
 /// <param name="channel"></param>
 public void Add(GUIAnimation animation)
 {
     mAnimations.Add(animation);
 }