Ejemplo n.º 1
0
 public override void LoadText(ContentManager content, string put)
 {
     base.LoadText(content, put);
     buttonBack.LoadText(content, "GuiElements\\button_back");
     buttonHome.LoadText(content, "GuiElements\\button_home");
     buttonSettings.LoadText(content, "GuiElements\\button_settings");
     font          = content.Load <SpriteFont>("Fonts\\GameFont");
     this.content  = content;
     currentScreen = new LoadingScreen(this);
 }
Ejemplo n.º 2
0
 public override void Update()
 {
     currentScreen.Update();
     if (Core.mNewState.LeftButton == ButtonState.Pressed && Core.mNewState.Y > position.Y - screenHeight / 2 && Core.mNewState.Y < position.Y + screenHeight / 2 &&
         Core.mNewState.X > 0 && Core.mNewState.X < Core.screenWidth)
     {
         if (mousePressPos == Vector2.Zero)
         {
             mousePressPos = new Vector2(Core.mNewState.X, Core.mNewState.Y);
         }
         raznostMousePos = new Vector2(Core.mNewState.X - mousePressPos.X, Core.mNewState.Y - mousePressPos.Y);
         isMousePress    = true;
     }
     else
     {
         mousePressPos = Vector2.Zero;
         isMousePress  = false;
     }
     if (Core.mNewState.LeftButton == ButtonState.Released && Core.mOldState.LeftButton == ButtonState.Pressed)
     {
         if (buttonBack.rect.Contains(Core.mNewState.X, Core.mNewState.Y))
         {
             currentScreen.Back();
         }
         else if (buttonHome.rect.Contains(Core.mNewState.X, Core.mNewState.Y))
         {
             if (currentScreen.GetType() == typeof(MainScreen))
             {
             }
             else
             {
                 currentScreen = new MainScreen(this);
             }
         }
         else if (buttonSettings.rect.Contains(Core.mNewState.X, Core.mNewState.Y))
         {
         }
         else
         {
             currentScreen.Click();
         }
     }
     buttonBack.Update();
     buttonHome.Update();
     buttonSettings.Update();
 }
Ejemplo n.º 3
0
 public void ChangeScreen(PhoneScreen screen)
 {
     currentScreen = screen;
 }