Beispiel #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (AnimationViewer game = new AnimationViewer())
       {
     game.Run();
       }
 }
Beispiel #2
0
        private void newAnimationButton_Click(object sender, EventArgs e)
        {
            var anim = new AnimationViewer();

            anim.MdiParent = this;
            anim.Show();
            animations.Add(anim);
        }
Beispiel #3
0
        public void tsmProperties_Click(object sender, EventArgs e)
        {
            PropertiesDialog.ShowDialog();
            if (!string.IsNullOrEmpty(PropertiesDialog.BackgroundPreview))
            {
                AnimationViewer.LoadBackgroundPreview(PropertiesDialog.BackgroundPreview);

                ActiveAnimation.ActiveAnimationBackground.ResetCamera();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Load an Animation at selected path.
        /// </summary>
        /// <param name="AnimationPath">Path from which to open the Animation.</param>
        private void LoadAnimation(string AnimationPath)
        {
            string Name = AnimationPath.Substring(0, AnimationPath.Length - 4).Substring(19);

            this.Text = Name + " - Project Eternity Animation Editor";

            AnimationViewer.Preload();

            ActiveAnimation         = new AnimationClassEditor(Name);
            ActiveAnimation.Content = new ContentManager(AnimationViewer.Services);
            ActiveAnimation.Content.RootDirectory = "Content";
            AnimationViewer.ActiveAnimation       = ActiveAnimation;

            AnimationViewer.Services.AddService <GraphicsDevice>(AnimationViewer.GraphicsDevice);
            ActiveAnimation.Load();

            PropertiesDialog.txtScreenWidth.Value  = ActiveAnimation.ScreenWidth;
            PropertiesDialog.txtScreenHeight.Value = ActiveAnimation.ScreenHeight;

            PropertiesDialog.txtLoopStart.Value = ActiveAnimation.LoopStart;
            PropertiesDialog.txtLoopEnd.Value   = ActiveAnimation.LoopEnd;

            foreach (KeyValuePair <string, Timeline> ActiveTimeline in ActiveAnimation.DicTimeline)
            {
                if (ActiveTimeline.Value is AnimationOriginTimeline)
                {
                    continue;
                }

                if (ActiveTimeline.Value is VisibleTimeline)
                {
                    ActiveTimeline.Value.OnAnimationEditorLoad(ActiveAnimation);
                    ToolStripMenuItem tsmNewItem = new ToolStripMenuItem(ActiveTimeline.Value.TimelineEventType);
                    tsmNewItem.Tag    = ActiveTimeline.Value;
                    tsmNewItem.Click += AnimationViewer.tsmNewItem_Click;
                    AnimationViewer.spawnNewToolStripMenuItem.DropDownItems.Add(tsmNewItem);
                }
            }

            for (int L = 0; L < AnimationViewer.ActiveAnimation.ListAnimationLayer.BasicLayerCount; L++)
            {
                foreach (var ActiveTimelineFrame in AnimationViewer.ActiveAnimation.ListAnimationLayer[L].DicTimelineEvent.Values)
                {
                    foreach (var ActiveTimeline in ActiveTimelineFrame)
                    {
                        ActiveTimeline.OnAnimationEditorLoad(ActiveAnimation);
                    }
                }
            }

            panTimelineViewer.SetActiveAnimation(ActiveAnimation);
        }