public void SelectNext() { Game.Instance.AudioPlayer.Play(Menu.ChangeSound, 0.5f); SelectedItem.Deactivate(); selected++; if (selected == MenuItems.Length) { selected = 0; } SelectedItem.Activate(); selectedSize.Start(Game.Instance.GlobalClock.ContinuousMilliseconds); }
public ItemizedMenuScreen(Menu menu) : base(menu, new Vector2(640, 360)) { //this.width = width; selectedSize = new SineFloat(0.7f, 0.9f, 10.0f); unselectedSize = new SineFloat(0.48f, 0.52f, 3.0f); selectedSize.Start(Game.Instance.GlobalClock.ContinuousMilliseconds); unselectedSize.Start(Game.Instance.GlobalClock.ContinuousMilliseconds); }
public PlayerMenu(Menu menu, LevelMenu levelMenu) : base(menu, new Vector2(640, 160)) { this.levelMenu = levelMenu; playerBackgroundInactive = Game.Instance.ContentManager.Load <Texture2D>("Sprites/Menu/robot_selection_background_inactive"); DrawPrevious = false; // initialize walking player hack Effect clonedEffect = Game.Instance.ContentManager.Load <Effect>("Effects/Basic/Basic").Clone(); playerModel = Game.Instance.ContentManager.Load <MagmaModel>("Models/Player/robot_grp").XnaModel; playerMesh = playerModel.Meshes[0]; foreach (ModelMeshPart meshPart in playerMesh.MeshParts) { Effect oldEffect = meshPart.Effect; meshPart.Effect = clonedEffect; oldEffect.Dispose(); } animator = new ModelAnimator(playerModel); walkController = new AnimationController(Game.Instance, animator.Animations["walk"]); Game.Instance.Components.RemoveAt(Game.Instance.Components.Count - 1); foreach (BonePose p in animator.BonePoses) { p.CurrentController = walkController; p.CurrentBlendController = null; p.BlendFactor = 0.0f; } playerPreview = new RenderTarget2D[MaxPlayers]; for (int i = 0; i < MaxPlayers; ++i) { playerPreview[i] = new RenderTarget2D(Game.Instance.GraphicsDevice, 445, 445, false, Game.Instance.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8); } playerTexture = Game.Instance.ContentManager.Load <Texture2D>("Textures/Player/Robot_texture10"); specularTexture = Game.Instance.ContentManager.Load <Texture2D>("Textures/Player/robot_spec"); playerBoxSize = new SineFloat(0.96f, 1.0f, 8.0f); playerBoxSize.Start(0.001f); }
private Menu() { StaticStringStrength = new SineFloat(0.7f, 1.0f, 2.5f); StaticStringStrength.Start(0.001); }