예제 #1
0
 public void OnlyFadeIn()
 {
     abh.MinMaxReached -= new AlphaBlendHelper.OnMinMaxReached(abh_MinMaxReached);
     abh                = new AlphaBlendHelper(0, 255, 255, -Speed);
     State              = eState.FadingIn;
     abh.MinMaxReached += new AlphaBlendHelper.OnMinMaxReached(abh_MinMaxReached);
 }
예제 #2
0
        void abh_MinMaxReached(AlphaBlendHelper abh)
        {
            switch (State)
            {
            case eState.None:
                throw new Exception("");

            case eState.FadingOut:
                State = eState.FadingIn;
                if (StartFadeIn != null)
                {
                    StartFadeIn(this);
                }
                break;

            case eState.FadingIn:
                State = eState.None;
                if (Finish != null)
                {
                    Finish(this);
                }
                break;

            default:
                throw new CaseStatementMissingException();
            }
        }
예제 #3
0
 /// <summary>
 /// Fades the screen out and in again
 /// </summary>
 /// <param name="screenSize"></param>
 /// <param name="speed"></param>
 public ScreenFader(Size screenSize, int speed)
 {
     Speed              = speed;
     abh                = new AlphaBlendHelper(0, 255, 0, Speed);
     abh.MinMaxReached += new AlphaBlendHelper.OnMinMaxReached(abh_MinMaxReached);
     ScreenSize         = screenSize;
     State              = eState.FadingOut;
 }