private void PlayAnimation(string name, int duration, bool loop = false)
        {
            if (_scheduledBackground != null)
            {
                _scheduledBackground.Dispose();
                _scheduledBackground = null;
            }

            ChromaAnimationAPI.PlayAnimationName(ANIMATION_PATH + "/" + name + ".chroma", loop);

            if (duration > 0)
            {
                _scheduledBackground = ExecutionPlan.Delay(duration, PlayBackground);
            }
        }
Beispiel #2
0
        public static void Update()
        {
            string curr = "Animations/Key.chroma";

            ChromaAnimationAPI.CloseAnimationName(curr);

            for (int i = 0; i < 127; i++)
            {
                try
                {
                    ChromaAnimationAPI.SetKeyColorAllFramesRGBName(curr, (int)chromaKeys[i], rValue[i], gValue[i], bValue[i]);
                }
                catch
                {
                }
            }

            ChromaAnimationAPI.PlayAnimationName(curr, true);
        }