Exemple #1
0
 public static LTransition NewPShadow(PShadowEffect effect)
 {
     if (GLEx.Self != null)
     {
         LTransition transition = new LTransition();
         transition.SetTransitionListener(new _PShadow(effect));
         transition.SetDisplayGameUI(true);
         transition.code = 1;
         return(transition);
     }
     return(null);
 }
Exemple #2
0
 public static LTransition NewEmpty()
 {
     if (GLEx.Self != null)
     {
         LTransition transition = new LTransition();
         transition.SetTransitionListener(new _Empty());
         transition.SetDisplayGameUI(false);
         transition.code = 0;
         return(transition);
     }
     return(null);
 }
Exemple #3
0
 public static LTransition NewCross(int c, LTexture texture)
 {
     if (GLEx.Self != null)
     {
         LTransition transition = new LTransition();
         transition.SetTransitionListener(new _Cross(c, texture));
         transition.SetDisplayGameUI(true);
         transition.code = 1;
         return(transition);
     }
     return(null);
 }
Exemple #4
0
 public static LTransition NewFade(int type, LColor c)
 {
     if (GLEx.Self != null)
     {
         LTransition transition = new LTransition();
         transition.SetTransitionListener(new _Fade(type, c));
         transition.SetDisplayGameUI(true);
         transition.code = 1;
         return(transition);
     }
     return(null);
 }
Exemple #5
0
 public static LTransition NewCycle(int type)
 {
     if (GLEx.Self != null)
     {
         LTransition transition = new LTransition();
         transition.SetTransitionListener(new _Cycle(type));
         transition.SetDisplayGameUI(false);
         transition.code = 0;
         return(transition);
     }
     return(null);
 }
Exemple #6
0
 public static LTransition NewCross(int c, LTexture texture)
 {
     if (GLEx.Self != null)
     {
         LTransition transition = new LTransition();
         transition.SetTransitionListener(new _Cross(c, texture));
         transition.SetDisplayGameUI(true);
         transition.code = 1;
         return transition;
     }
     return null;
 }
        public static LTransition NewArc(LColor c)
        {
            if (GLEx.Self != null)
            {

                LTransition transition = new LTransition();
                transition.SetTransitionListener(new _Arc(c));
                transition.SetDisplayGameUI(true);
                transition.code = 1;
                return transition;
            }
            return null;
        }
Exemple #8
0
 public static LTransition NewFadeIn()
 {
     return(LTransition.NewFade(ISprite_Constants.TYPE_FADE_IN));
 }
Exemple #9
0
 public static LTransition NewPShadow(PShadowEffect effect)
 {
     if (GLEx.Self != null)
     {
         LTransition transition = new LTransition();
         transition.SetTransitionListener(new _PShadow(effect));
         transition.SetDisplayGameUI(true);
         transition.code = 1;
         return transition;
     }
     return null;
 }
Exemple #10
0
 public static LTransition NewEmpty()
 {
     if (GLEx.Self != null)
     {
         LTransition transition = new LTransition();
         transition.SetTransitionListener(new _Empty());
         transition.SetDisplayGameUI(false);
         transition.code = 0;
         return transition;
     }
     return null;
 }
Exemple #11
0
 private void SetScreen(Screen @screen, bool @put)
 {
     lock (this)
     {
         if (screen == null)
         {
             this.isInstance = false;
             throw new RuntimeException(
                     "Cannot create a [Screen] instance !");
         }
         InitDestory();
         if (!LSystem.isLogo)
         {
             if (currentControl != null)
             {
                 SetTransition(screen.OnTransition());
             }
             else
             {
                 LTransition transition = screen.OnTransition();
                 if (transition == null)
                 {
                     switch (MathUtils.Random(0, 3))
                     {
                         case 0:
                             transition = LTransition.NewFadeIn();
                             break;
                         case 1:
                             transition = LTransition.NewArc();
                             break;
                         case 2:
                             transition = LTransition
                                     .NewSplitRandom(LColor.black);
                             break;
                         case 3:
                             transition = LTransition
                                     .NewCrossRandom(LColor.black);
                             break;
                     }
                 }
                 SetTransition(transition);
             }
         }
         screen.SetOnLoadState(false);
         if (currentControl == null)
         {
             currentControl = screen;
         }
         else
         {
             lock (currentControl)
             {
                 currentControl.Destroy();
                 currentControl = screen;
             }
         }
         this.isInstance = true;
         if (screen is EmulatorListener)
         {
             SetEmulatorListener((EmulatorListener)screen);
         }
         else
         {
             SetEmulatorListener(null);
         }
         StartTransition();
         screen.OnCreate(LSystem.screenRect.width, LSystem.screenRect.height);
         if (!running || GLEx.Device == null || loading_Control != null)
         {
             screen.SetClose(false);
             screen.OnLoad();
             screen.SetOnLoadState(true);
             screen.OnLoaded();
             EndTransition();
         }
         else
         {
             Thread load = null;
             try
             {
                 load = new _LoadingScreen(this, screen);
                 load.Start();
             }
             catch (System.Exception ex)
             {
                 throw new RuntimeException(currentControl.GetName()
                         + " onLoad:" + ex.Message);
             }
             finally
             {
                 load = null;
             }
         }
         if (screen != null)
         {
             if (screen is LFlickerListener)
             {
                 if (currentInput != null)
                 {
                     currentInput.Flicker = (LFlickerListener)screen;
                 }
             }
         }
         if (put)
         {
             screens.AddLast(screen);
         }
         loading_Control = null;
         Thread.Yield();
     }
 }
Exemple #12
0
 public static LTransition NewCycle(int type)
 {
     if (GLEx.Self != null)
     {
         LTransition transition = new LTransition();
         transition.SetTransitionListener(new _Cycle(type));
         transition.SetDisplayGameUI(false);
         transition.code = 0;
         return transition;
     }
     return null;
 }
Exemple #13
0
        private void SetScreen(Screen screen, bool put)
        {
            if (currentControl != null && currentControl.IsOnLoadComplete())
            {
                return;
            }
            lock (this)
            {
                if (screen == null)
                {
                    this.isInstance = false;
                    throw new RuntimeException(
                              "Cannot create a [Screen] instance !");
                }
                GLLoader.Destory();
                if (!LSystem.isLogo)
                {
                    if (currentControl != null)
                    {
                        SetTransition(screen.OnTransition());
                    }
                    else
                    {
                        LTransition transition = screen.OnTransition();
                        if (transition == null)
                        {
                            switch (MathUtils.Random(0, 3))
                            {
                            case 0:
                                transition = LTransition.NewFadeIn();
                                break;

                            case 1:
                                transition = LTransition.NewArc();
                                break;

                            case 2:
                                transition = LTransition
                                             .NewSplitRandom(LColor.black);
                                break;

                            case 3:
                                transition = LTransition
                                             .NewCrossRandom(LColor.black);
                                break;
                            }
                        }
                        SetTransition(transition);
                    }
                }
                screen.SetOnLoadState(false);
                if (currentControl == null)
                {
                    currentControl = screen;
                }
                else
                {
                    lock (currentControl)
                    {
                        currentControl.Destroy();
                        currentControl = screen;
                    }
                }
                this.isInstance = true;
                if (screen is EmulatorListener)
                {
                    SetEmulatorListener((EmulatorListener)screen);
                }
                else
                {
                    SetEmulatorListener(null);
                }

                screen.OnCreate(LSystem.screenRect.width, LSystem.screenRect.height);

                LSystem.CallScreenRunnable(new _LoadingScreen(this, screen));

                if (put)
                {
                    screens.AddLast(screen);
                }
                loading_Control = null;
            }
        }
Exemple #14
0
 public void SetTransition(LTransition t)
 {
     this.transition = t;
 }
Exemple #15
0
        private void SetScreen(Screen screen, bool put)
        {
            if (currentControl != null && currentControl.IsOnLoadComplete())
            {
                return;
            }
            lock (this)
            {
                if (screen == null)
                {
                    this.isInstance = false;
                    throw new RuntimeException(
                            "Cannot create a [Screen] instance !");
                }
                GLLoader.Destory();
                if (!LSystem.isLogo)
                {
                    if (currentControl != null)
                    {
                        SetTransition(screen.OnTransition());
                    }
                    else
                    {
                        LTransition transition = screen.OnTransition();
                        if (transition == null)
                        {
                            switch (MathUtils.Random(0, 3))
                            {
                                case 0:
                                    transition = LTransition.NewFadeIn();
                                    break;
                                case 1:
                                    transition = LTransition.NewArc();
                                    break;
                                case 2:
                                    transition = LTransition
                                            .NewSplitRandom(LColor.black);
                                    break;
                                case 3:
                                    transition = LTransition
                                            .NewCrossRandom(LColor.black);
                                    break;
                            }
                        }
                        SetTransition(transition);
                    }
                }
                screen.SetOnLoadState(false);
                if (currentControl == null)
                {
                    currentControl = screen;
                }
                else
                {
                    lock (currentControl)
                    {
                        currentControl.Destroy();
                        currentControl = screen;
                    }
                }
                this.isInstance = true;
                if (screen is EmulatorListener)
                {
                    SetEmulatorListener((EmulatorListener)screen);
                }
                else
                {
                    SetEmulatorListener(null);
                }

                screen.OnCreate(LSystem.screenRect.width, LSystem.screenRect.height);

                LSystem.CallScreenRunnable(new _LoadingScreen(this, screen));

                if (put)
                {
                    screens.AddLast(screen);
                }
                loading_Control = null;
            }
        }
Exemple #16
0
 public void SetTransition(LTransition t)
 {
     this.transition = t;
 }
Exemple #17
0
        private void SetScreen(Screen @screen, bool @put)
        {
            lock (this)
            {
                if (screen == null)
                {
                    this.isInstance = false;
                    throw new RuntimeException(
                              "Cannot create a [Screen] instance !");
                }
                InitDestory();
                if (!LSystem.isLogo)
                {
                    if (currentControl != null)
                    {
                        SetTransition(screen.OnTransition());
                    }
                    else
                    {
                        LTransition transition = screen.OnTransition();
                        if (transition == null)
                        {
                            switch (MathUtils.Random(0, 3))
                            {
                            case 0:
                                transition = LTransition.NewFadeIn();
                                break;

                            case 1:
                                transition = LTransition.NewArc();
                                break;

                            case 2:
                                transition = LTransition
                                             .NewSplitRandom(LColor.black);
                                break;

                            case 3:
                                transition = LTransition
                                             .NewCrossRandom(LColor.black);
                                break;
                            }
                        }
                        SetTransition(transition);
                    }
                }
                screen.SetOnLoadState(false);
                if (currentControl == null)
                {
                    currentControl = screen;
                }
                else
                {
                    lock (currentControl)
                    {
                        currentControl.Destroy();
                        currentControl = screen;
                    }
                }
                this.isInstance = true;
                if (screen is EmulatorListener)
                {
                    SetEmulatorListener((EmulatorListener)screen);
                }
                else
                {
                    SetEmulatorListener(null);
                }
                StartTransition();
                screen.OnCreate(LSystem.screenRect.width, LSystem.screenRect.height);
                if (!running || GLEx.Device == null || loading_Control != null)
                {
                    screen.SetClose(false);
                    screen.OnLoad();
                    screen.SetOnLoadState(true);
                    screen.OnLoaded();
                    EndTransition();
                }
                else
                {
                    Thread load = null;
                    try
                    {
                        load = new _LoadingScreen(this, screen);
                        load.Start();
                    }
                    catch (System.Exception ex)
                    {
                        throw new RuntimeException(currentControl.GetName()
                                                   + " onLoad:" + ex.Message);
                    }
                    finally
                    {
                        load = null;
                    }
                }
                if (screen != null)
                {
                    if (screen is LFlickerListener)
                    {
                        if (currentInput != null)
                        {
                            currentInput.Flicker = (LFlickerListener)screen;
                        }
                    }
                }
                if (put)
                {
                    screens.AddLast(screen);
                }
                loading_Control = null;
                Thread.Yield();
            }
        }
Exemple #18
0
 public static LTransition NewFadeOut()
 {
     return(LTransition.NewFade(ISprite_Constants.TYPE_FADE_OUT));
 }
Exemple #19
0
 public static LTransition NewFadeIn()
 {
     return(LTransition.NewFade(FadeEffect.TYPE_FADE_IN));
 }
Exemple #20
0
 public static LTransition NewFadeOut()
 {
     return(LTransition.NewFade(FadeEffect.TYPE_FADE_OUT));
 }
Exemple #21
0
 public static LTransition NewFade(int type)
 {
     return(LTransition.NewFade(type, LColor.black));
 }