Beispiel #1
0
 void m_t_Tick(object sender, EventArgs e)
 {
     for (int i = 0; i < m_anims.Count; i++)
     {
         if (m_starts[i] + m_anims[i].duration < Environment.TickCount)
         {
             m_starts.RemoveAt(i);
             m_frames.RemoveAt(i);
             m_anims.RemoveAt(i);
             i--;
             if (m_anims.Count <= 0)
             {
                 m_t.Enabled = false;
             }
             continue;
         }
         else
         {
             float t = (Environment.TickCount - m_starts[i]) / (float)m_anims[i].duration;
             int   x = (int)((m_anims[i].end.X - m_anims[i].start.X) * t + m_anims[i].start.X);
             int   y = (int)((m_anims[i].end.Y - m_anims[i].start.Y) * t + m_anims[i].start.Y);
             m_frames[i] = new AnimFrame(m_frames[i].bmp, new Point(x, y));
         }
     }
     if (Tick != null)
     {
         Tick(sender, e);
     }
 }
 void m_t_Tick(object sender, EventArgs e)
 {
     for (int i = 0; i < m_anims.Count; i++)
     {
         if (m_starts[i] + m_anims[i].duration < Environment.TickCount)
         {
             m_starts.RemoveAt(i);
             m_frames.RemoveAt(i);
             m_anims.RemoveAt(i);
             i--;
             if (m_anims.Count <= 0)
                 m_t.Enabled = false;
             continue;
         }
         else
         {
             float t = (Environment.TickCount - m_starts[i]) / (float)m_anims[i].duration;
             int x = (int)((m_anims[i].end.X - m_anims[i].start.X) * t + m_anims[i].start.X);
             int y = (int)((m_anims[i].end.Y - m_anims[i].start.Y) * t + m_anims[i].start.Y);
             m_frames[i] = new AnimFrame(m_frames[i].bmp, new Point(x, y));
         }
     }
     if (Tick != null)
         Tick(sender, e);
 }