Beispiel #1
0
 public Screen(Screen parent, ScreenManager manager)
 {
     this.parent = parent;
     this.screenmanager = manager;
     this.ready = true;
     this.transition_time = 0.5f;
 }
Beispiel #2
0
 public Instructions(Screen parent, ScreenManager manager)
     : base(parent, manager)
 {
     logo = Resources.instructions_texture_region;
     transition_time = 3;
     background = 1;
 }
Beispiel #3
0
        public void FadeOut(Screen screen)
        {
            if (screen == null || !screen.IsReady())
                return;

            screen.FadeOut();
            DelayedRemoved(screen);
        }
Beispiel #4
0
        public void FadeIn(Screen screen)
        {
            if (screen == null || !screen.IsReady())
                return;

            SetActive(screen);
            screen.FadeIn();
        }
Beispiel #5
0
        public void SetActive(Screen screen)
        {
            if (screen == null || !screen.IsReady())
                return;

            input.Update();

            if (!screen_list.Contains(screen))
                screen_list.Add(screen);

            active = screen;
        }
Beispiel #6
0
 public bool IsActive(Screen screen)
 {
     return screen == active;
 }
Beispiel #7
0
 private void DelayedRemoved(Screen screen)
 {
     Timer t = TimerCollection.GetInstance().Create(screen.transition_time, false, Remove); t.tag = screen;
 }
Beispiel #8
0
        public void Transition(Screen from, Screen to)
        {
            if (from == null || !from.IsReady())
                return;
            if (to == null || !to.IsReady())
                return;

            FadeOut(from);
            FadeIn(to);
        }
Beispiel #9
0
 public void TransitionTo(Screen screen)
 {
     screenmanager.Transition(this, screen);
 }
Beispiel #10
0
 public Title(Screen parent, ScreenManager manager)
     : base(parent, manager)
 {
     logo = Resources.logo_texture_region;
     transition_time = 3;
     background = 1;
 }