예제 #1
0
        /// <summary>
        /// If this form is a child, this function is called instead of Play().
        /// It will initialize all variables and start the first animation using CHILD, not SPAWN.
        /// </summary>
        /// <param name="aniID">Animation playing by the parent (child will synchronize to this animation).</param>
        public void PlayChild(int aniID)
        {
            TChild child = Animations.GetAnimationChild(aniID);

            timer1.Enabled = false;                     // Stop the timer

            iAnimationStep = 0;                         // First step
            hwndWindow     = (IntPtr)0;                 // It is not over a window

            Top = child.Position.Y.GetValue();          // Set position. If parent is flipped, mirror the position
            if (bMoveLeft)
            {
                Left = child.Position.X.GetValue();
            }
            else
            {
                Left = child.Position.X.GetValue();
            }
            dPosX                  = Left;
            dPosY                  = Top;
            dOffsetY               = 0.0;
            Visible                = true;              // Now we can show this child
            Opacity                = 1.0;
            pictureBox1.Cursor     = Cursors.Default;
            pictureBox1.MouseDown += (s, e) => { };     // Replace the "drag and drop" functionality

            SetNewAnimation(child.Next);                // Set next animation to play

            timer1.Enabled = true;                      // Enable timer (interval is known, now)
        }
예제 #2
0
        /// <summary>
        /// If this form is a child, this function is called instead of Play().
        /// It will initialize all variables and start the first animation using CHILD, not SPAWN.
        /// </summary>
        /// <param name="aniID">Animation playing by the parent (child will synchronize to this animation).</param>
        public void PlayChild(int aniID)
        {
            TChild child = Animations.GetAnimationChild(aniID);

            timer1.Enabled = false;                     // Stop the timer

            iAnimationStep = 0;                         // First step
            hwndWindow     = (IntPtr)0;                 // It is not over a window

            Top = child.Position.Y.GetValue();          // Set position. If parent is flipped, mirror the position
            if (bMoveLeft)
            {
                Left = child.Position.X.GetValue();
            }
            else
            {
                Left = Screen.PrimaryScreen.Bounds.Width - child.Position.X.GetValue() - Width;
            }
            dPosX    = Left;
            dPosY    = Top;
            dOffsetY = 0.0;
            Visible  = true;                            // Now we can show this child
            Opacity  = 1.0;
            SetNewAnimation(child.Next);                // Set next animation to play

            timer1.Enabled = true;                      // Enable timer (interval is known, now)
        }