Example #1
0
        public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition)
        {
            List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>();

            AnimatedChainSpawnerHelper NewSpawner = new AnimatedChainSpawnerHelper();

            if (NewSpawner.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                AnimatedChainTimeline NewAnimatedBitmapSpawner = new AnimatedChainTimeline(NewSpawner.ChainLinkViewer.content,
                                                                                           NewSpawner.ChainLinkPath, new Vector2((float)NewSpawner.txtChainLinkOriginX.Value, (float)NewSpawner.txtChainLinkOriginY.Value),
                                                                                           NewSpawner.ChainEndPath, new Vector2((float)NewSpawner.txtChainEndOriginX.Value, (float)NewSpawner.txtChainEndOriginY.Value),
                                                                                           NewSpawner.ChainStartPath, new Vector2((float)NewSpawner.txtChainStartOriginX.Value, (float)NewSpawner.txtChainStartOriginY.Value));

                NewAnimatedBitmapSpawner.Position   = new Vector2(535, 170);
                NewAnimatedBitmapSpawner.SpawnFrame = KeyFrame;
                NewAnimatedBitmapSpawner.DeathFrame = KeyFrame + 10;
                NewAnimatedBitmapSpawner.IsUsed     = true;//Disable the spawner as we spawn the AnimatedBitmap manually.
                NewAnimatedBitmapSpawner.Add(KeyFrame, new AnimatedChainKeyFrame(NewAnimatedBitmapSpawner.Position,
                                                                                 true, -1, 50));

                ReturnValue.Add(NewAnimatedBitmapSpawner);
            }

            return(ReturnValue);
        }
Example #2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService svc = (IWindowsFormsEditorService)
                                             provider.GetService(typeof(IWindowsFormsEditorService));

            if (svc != null)
            {
                AnimatedChainSpawnerHelper NewSpawner = new AnimatedChainSpawnerHelper((string)value);
                if (NewSpawner.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    value = NewSpawner;
                }
            }
            return(value);
        }