Example #1
0
        /// <summary>
        ///     Static constructor adds lightning bolts in different colors to both frames
        /// </summary>
        static CrashAnimation()
        {
            var newFrames = new List <ColorScheme>();

            var red    = new ColorScheme(Color.red);
            var yellow = new ColorScheme(Color.yellow);

            // Generate first few frames
            newFrames.AddRange(AnimationUtils.InterpolateFrames(red, yellow, 3));
            // Add the way back to the original
            newFrames.AddRange(newFrames.ToArray().Reverse());
            // Double it
            newFrames.AddRange(newFrames.ToArray());
            // Quadruple it
            newFrames.AddRange(newFrames.ToArray());
            // Octuple it
            newFrames.AddRange(newFrames.ToArray());

            for (var i = 0; i < 30; i++)
            {
                newFrames.Add(AnimationUtils.CircularSineWave(Color.red, Color.yellow, i));
            }

            newFrames.AddRange(AnimationUtils.InterpolateFrames(newFrames.Last(), new ColorScheme(Color.black), 10));

            frames = newFrames.ToArray();
        }
Example #2
0
        /// <summary>
        ///     Static constructor adds lightning bolts in different colors to both frames
        /// </summary>
        static SplashdownAnimation()
        {
            var newFrames = new List <ColorScheme>();

            var uninterpolated = GenerateAnimationFrames();

            for (var i = 0; i < uninterpolated.Length - 1; i++)
            {
                newFrames.AddRange(AnimationUtils.InterpolateFrames(uninterpolated[i], uninterpolated[i + 1], 5));
            }

            newFrames.AddRange(
                AnimationUtils.InterpolateFrames(
                    uninterpolated[uninterpolated.Length - 1],
                    new ColorScheme(new Color(0f, 0f, .2f)),
                    10
                    )
                );

            frames = newFrames.ToArray();
        }
Example #3
0
 /// <summary>Static constructor interpolates from blue to logo.</summary>
 static LogoAnimation()
 {
     frames = AnimationUtils.InterpolateFrames(new ColorScheme(Color.blue), new LogoScheme(), 20);
 }