public WaitingMessage()
        {
            _hideAfterCurrentAnimationCycleComplete = false;
            _position = Vector2.Zero;

            _animationEngine = new ColourAnimationEngine(this);
            _animationEngine.KeyframeCompletionHandler = HandleAnimationFrameCompletion;
        }
Exemplo n.º 2
0
        protected virtual Serializer Deserialize(Serializer serializer)
        {
            MappingName = serializer.GetDataItem<string>("texture");
            Frame = serializer.GetDataItem<Rectangle>("frame");
            Origin = serializer.GetDataItem<Vector2>("origin");
            DisplayPosition = serializer.GetDataItem<Vector2>("display-position");
            Visible = serializer.GetDataItem<bool>("visible");
            Scale = serializer.GetDataItem<float>("scale");
            Rotation = serializer.GetDataItem<float>("rotation");
            Tint = serializer.GetDataItem<Color>("tint");

            AnimationEngine = null;
            switch (serializer.GetDataItem<string>("engine-type"))
            {
                case "colour":
                    AnimationEngine = new ColourAnimationEngine(this);
                    WireUpAnimationEngineHooks();
                    serializer.KnownSerializedObjects.Add(AnimationEngine);
                    AnimationEngine = serializer.GetDataItem<ColourAnimationEngine>("animation-engine");
                    break;
                case "transform":
                    AnimationEngine = new TransformationAnimationEngine(this);
                    WireUpAnimationEngineHooks();
                    serializer.KnownSerializedObjects.Add(AnimationEngine);
                    AnimationEngine = serializer.GetDataItem<TransformationAnimationEngine>("animation-engine");
                    break;
            }

            TextureManager.AddManagedObject(this);

            return serializer;
        }
Exemplo n.º 3
0
        public void RunPopupSequence(string sequenceName, bool hideWhenAnimationComplete)
        {
            Visible = true;

            _hideWhenAnimationComplete = hideWhenAnimationComplete;
            switch (AnimationDataManager.Sequences[sequenceName].SequenceType)
            {
                case AnimationSequence.AnimationSequenceType.Transformation:
                    if (!(AnimationEngine is TransformationAnimationEngine)) { AnimationEngine = new TransformationAnimationEngine(this); }
                    break;
                case AnimationSequence.AnimationSequenceType.Colour:
                    if (!(AnimationEngine is ColourAnimationEngine)) { AnimationEngine = new ColourAnimationEngine(this); }
                    break;
            }

            WireUpAnimationEngineHooks();
            AnimationEngine.Sequence = AnimationDataManager.Sequences[sequenceName];
        }