public void OnClose(bool doClose) { this.Opacity = 0.9; this.doClose = doClose; this.Enabled = false; showing = false; Atimer.Start(); }
public void OnShow() { this.Show(); showing = true; Opacity = 0.0; //窗体透明度为0 Atimer.Start(); //计时 if (!Sound.IsPlayingBGM) { Sound.PlayBGM("bgm_opening"); } this.Enabled = true; Clear(); }
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; } } }