示例#1
0
        /// <summary>Changes the framerate of this animation.</summary>
        public void ChangeFrameRate(int newRate)
        {
            FrameRate = newRate;

            // For each actively running animation..
            if (FirstInstance != null)
            {
                // What's the delay in seconds of a frame?
                float newDelay = 1f / (float)FrameRate;

                // For each..
                SPAInstance current = FirstInstance;

                while (current != null)
                {
                    if (current.Animation == this)
                    {
                        current.FrameDelay = newDelay;
                    }

                    // Hop to the next one:
                    current = current.InstanceAfter;
                }
            }
        }
		public override void GoingOnDisplay(){
			
			if(Animation==null && SPAFile!=null){
				Animation=SPAFile.GetInstance();
			}
			
		}
示例#3
0
 /// <summary>Called when this image is going to be displayed.</summary>
 public void GoingOnDisplay()
 {
     if (Animated && Animation == null && SPAFile != null)
     {
         Animation = SPAFile.GetInstance();
     }
 }
		public override void GoingOffDisplay(){
		
			if(Animation!=null){
				Animation.Stop();
				Animation=null;
			}
			
		}
示例#5
0
 /// <summary>Called when this image is no longer being displayed.</summary>
 public void GoingOffDisplay()
 {
     if (Animated && Animation != null)
     {
         Animation.Stop();
         Animation = null;
     }
 }
示例#6
0
 public override void GoingOffDisplay()
 {
     if (Animation != null)
     {
         Animation.Stop();
         Animation = null;
     }
 }
示例#7
0
        /// <summary>Gets how many animations are actively playing.</summary>
        /// <returns>The number of animations currently playing.</returns>
        public static int ActiveCount()
        {
            int         count   = 0;
            SPAInstance current = FirstInstance;

            while (current != null)
            {
                count++;
                current = current.InstanceAfter;
            }
            return(count);
        }
示例#8
0
 /// <summary>Advances playback of any running animations and performs some garbage collection.
 /// Called by <see cref="UI.Update"/>.</summary>
 public static void Update()
 {
     // Advance any active animations.
     // These are all animations in our Instance chain.
     if (FirstInstance != null)
     {
         SPAInstance current = FirstInstance;
         while (current != null)
         {
             current.Update();
             current = current.InstanceAfter;
         }
     }
 }
示例#9
0
        /// <summary>Creates a playable instance of this animation.
        /// Instances are required as the same animation could be visible multiple times.</summary>
        /// <returns>A playable form of this animation.</returns>
        public SPAInstance GetInstance()
        {
            // Create the instance:
            SPAInstance instance = new SPAInstance(this);

            // Push the instance to the global animate queue.
            if (FirstInstance == null)
            {
                FirstInstance = LastInstance = instance;
            }
            else
            {
                instance.InstanceBefore = LastInstance;
                LastInstance            = LastInstance.InstanceAfter = instance;
            }
            return(instance);
        }
示例#10
0
 /// <summary>Clears all active SPA animations.</summary>
 public static void Clear()
 {
     LastInstance = FirstInstance = null;
 }
		/// <summary>Called when this image is no longer being displayed.</summary>
		public void GoingOffDisplay(){
			if(Animated&&Animation!=null){
				Animation.Stop();
				Animation=null;
			}
		}
示例#12
0
//--------------------------------------