public void RemoveAnimatedObject(IAnimated toRemove)
 {
     if (_simpleObjectsToAnimate.Contains(toRemove))
     {
         _simpleObjectsToAnimate.Remove(toRemove);
     }
 }
 public void AddAnimatedObject(IAnimated toAdd)
 {
     if (!_simpleObjectsToAnimate.Contains(toAdd))
     {
         _simpleObjectsToAnimate.Add(toAdd);
     }
 }
Example #3
0
 private void setupDrawObj()
 {
     Bitmap bMap = new Bitmap(Image.FromFile(@"..\..\images\explosion.bmp"));
     var xFrames = 11;
     var yFrames = 1;
     var drawLocation = new Point(20, 20);
     drawObj = new Drawable(drawLocation, bMap, xFrames, yFrames, canvas);
 }
Example #4
0
        /// <summary>
        /// Event that is triggered when a nod in the TreeView get's selected
        /// If the nod is a different than the currently selected one (and not a folder)
        /// all running animations will be halted and all TabControls will be made invisible.
        /// Afterwards the needed TabControl will again be made visible and the forms size will be adjusted to it.
        /// </summary>
        /// <param name="sender">The object to trigger the event</param>
        /// <param name="e">the event args containing the node that was selected</param>
        private void tvwEffects_AfterSelect(object sender, TreeViewEventArgs e)
        {
            //saves the name of the selected node
            string hdmaEffect = tvwEffects.SelectedNode.Name;

            if (!Tabs.ContainsKey(hdmaEffect))              // \  if the name is not in the dictionary
            {
                return;                                     //  | for example one of the folders
            }
            if (ActiveTab == hdmaEffect)                    //  | or the same tab is selected twice
            {
                return;                                     // /  return
            }
            //the label at the beginning telling you to select a node.
            lblNoSelect.Visible = false;

            //makes al the TabControls invisible and stops the animation
            foreach (ITab GUI in Tabs.Values)
            {
                GUI.GetTabControl().Visible = false;
                IAnimated AnimatedGUI       = GUI as IAnimated;
                if (AnimatedGUI != null)
                {
                    AnimatedGUI.StopAnimation();
                }
            }

            //save the active node's name and make the tabcontrol visible
            TabControl T = Tabs[hdmaEffect].GetTabControl();

            T.Visible = true;
            ActiveTab = hdmaEffect;

            //adjust size
            using (Graphics g = this.CreateGraphics())
            {
                this.Width  = (int)Math.Ceiling((_splitterDistance + _widthAdd) * (g.DpiX / 96)) + T.Width;
                this.Height = (int)Math.Ceiling((T.Height + _heightAdder) * (g.DpiY / 96));                    // setzt die Weite der Main-control auf die der TabControl
                splitContainer1.SplitterDistance = (int)Math.Ceiling(_splitterDistance * (g.DpiX / 96));       // der Splitter würde dabei prozentuel verschoben werden, deswegen wird er wieder rückgesetzt.
            }
        }
 public void RemoveAnimatedObject(IAnimated toRemove)
 {
     if (_simpleObjectsToAnimate.Contains(toRemove)) { _simpleObjectsToAnimate.Remove(toRemove); }
 }
 public void AddAnimatedObject(IAnimated toAdd)
 {
     if (!_simpleObjectsToAnimate.Contains(toAdd)) { _simpleObjectsToAnimate.Add(toAdd); }
 }
Example #7
0
 internal void Add(IAnimated animatedSprite)
 {
     animates.Add(animatedSprite);
 }
Example #8
0
 public void Add ( IAnimated animatedSprite )
 {
     animates.Add( animatedSprite );
 }
Example #9
0
 internal void Add ( IAnimated animatedSprite )
 {
     animates.Add( animatedSprite );
 }
Example #10
0
 public void Add(IAnimated animatedSprite)
 {
     animates.Add(animatedSprite);
 }