コード例 #1
0
 public void OnClose(bool doClose)
 {
     this.Opacity = 0.9;
     this.doClose = doClose;
     this.Enabled = false;
     showing      = false;
     Atimer.Start();
 }
コード例 #2
0
 public void OnShow()
 {
     this.Show();
     showing = true;
     Opacity = 0.0;  //窗体透明度为0
     Atimer.Start(); //计时
     if (!Sound.IsPlayingBGM)
     {
         Sound.PlayBGM("bgm_opening");
     }
     this.Enabled = true;
     Clear();
 }
コード例 #3
0
        private void Atimer_Tick(object sender, EventArgs e)
        {
            double d = 0.02;

            if (showing)
            {
                if (Opacity + d >= 0.9)
                {
                    Opacity = 0.9;
                    Atimer.Stop();
                }
                else
                {
                    Opacity += d;
                }
            }
            else
            {
                if (Opacity - d <= 0.0)
                {
                    Opacity = 0.0;
                    Atimer.Stop();
                    if (doClose)
                    {
                        this.Close();
                    }
                    else
                    {
                        this.Visible = false;
                    }
                }
                else
                {
                    Opacity -= d;
                }
            }
        }