Example #1
0
 public void Update(GameTime gameTime)
 {
     if (Selected == true)
     {
         if (fadeEffect == null)
         {
             fadeEffect = new FadeEffect(0.5f, 1.0f, 0.5f);
         }
         imageselected.Alpha = fadeEffect.Update(gameTime);
     }
     else
     {
         imageselected.Alpha = 1.0f;
     }
 }
Example #2
0
        public void TransitionScreen(GameTime gameTime)
        {
            if (IsTransitioning)
            {
                fade.Alpha = fadeEffect.Update(gameTime);
                if (fade.Alpha >= 1.0f)
                {
                    currentscreen.UnloadContent();
                    currentscreen = (Screen)Activator.CreateInstance(Type.GetType("Game_Test." + newscreen));
                    currentscreen.LoadContent();
                    HasChangedScreen = true;
                }

                if (HasChangedScreen && fade.Alpha <= 0.0f)
                {
                    IsTransitioning = false;
                }
                fade.Update(gameTime);
            }
        }
Example #3
0
        public void Update(GameTime gameTime)
        {
            itemtitle.Update(gameTime);
            itemsetting.Update(gameTime);
            arrow_left.Update(gameTime);
            arrow_right.Update(gameTime);

            arrow_right.Position = new Vector2(tempPosition + ((itemsetting.GetTextSize(itemsetting.Text).X) + (10 * x_scale)), arrow_right.Position.Y);

            itemtitle.Color   = Color.Black;
            arrow_left.Color  = Color.Black;
            arrow_right.Color = Color.Black;

            if (IsSelected)
            {
                var temp = fadeeffect.Update(gameTime);
                itemtitle.Alpha   = temp;
                itemsetting.Alpha = temp;
                arrow_left.Alpha  = temp;
                arrow_right.Alpha = temp;
                switch (currentSelected)
                {
                case selection.arrowleft:
                    arrow_left.Color = Color.White;
                    break;

                case selection.arrowright:
                    arrow_right.Color = Color.White;
                    break;
                }

                if (InputManager.Instance.KeyPressed(Keys.Enter) || ScreenManager.Instance.Controllers[0].A_Button(true))
                {
                    if (currentSelected == selection.arrowleft)
                    {
                        currentIndex--;
                        if (currentIndex < 0)
                        {
                            currentIndex = maxIndex - 1;
                        }
                    }
                    if (currentSelected == selection.arrowright)
                    {
                        currentIndex++;
                        if (currentIndex >= maxIndex)
                        {
                            currentIndex = 0;
                        }
                    }
                }
            }
            else
            {
                itemtitle.Alpha   = 1.0f;
                itemsetting.Alpha = 1.0f;
                arrow_left.Alpha  = 1.0f;
                arrow_right.Alpha = 1.0f;
                itemtitle.Color   = Color.Black;
                arrow_left.Color  = Color.Black;
                arrow_right.Color = Color.Black;
            }
        }