public override void Initialize(ContentManager content) { base.Initialize(content); screenCamera = new LevelSelectCam(); scene = new Jabber.Scene.GameScene(new FarWorld(), Content); scene.Initialize(Content); BackButton b = new BackButton(); b.Initialize(Content); scene.AddNode(b); Button movie = new Button("ui/ui"); movie.Initialize(Content); movie.CreateFramesFromXML("ui/ui_frames"); movie.CurrentFrame = "movie"; movie.ResetDimensions(); movie.RegularScale = ScaleFactor * 0.48f; movie.ScaleOnHover = movie.RegularScale * 1.1f; movie.UniformScale = ScaleFactor * 0.48f; movie.PosX = -0.37f * BaseGame.Get.BackBufferWidth; movie.PosY = -0.42f * BaseGame.Get.BackBufferHeight; scene.AddNode(movie); int numLevels = 0; switch (location) { case "uluru": numLevels = NumLevelsUluru; break; case "polar": numLevels = NumLevelsPolar; break; case "bavaria": numLevels = NumLevelsBavaria; break; case "paris": numLevels = NumLevelsParis; break; case "vesuvius": numLevels = NumLevelsVesuvius; break; } (screenCamera as LevelSelectCam).NumLevels = numLevels; /* #if WINDOWS_PHONE using (IsolatedStorageFile isolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication()) { while (true) { string dir = "Content/Levels/" + location + "/Level" + (numLevels + 1) + ".xml"; try { // "Content/Levels/paris/Level2.xml"; XDocument.Load(dir); ++numLevels; } catch (Exception e) { break; } } } #else while (true) { if (File.Exists("Content/Levels/" + location + "/Level" + (numLevels + 1) + ".xml")) ++numLevels; else break; } #endif */ while (numLevels > 0) { int currentColumn = 0; while (true) { for (int j = 0; j < 4; j++) { if (numLevels == 0) { break; } for (int i = 0; i < 5; i++) { LevelButton but = new LevelButton(i, j, currentColumn, location); but.Initialize(Content); scene.AddNode(but); levelButtons.Add(but); --numLevels; if (numLevels == 0) { break; } } } if(numLevels == 0) { break; } ++currentColumn; } } blank = new BlankNess(); blank.fullBlankity = 0.75f; blank.Initialize(Content); scene.AddNode(blank); blank.RaiseFlag(Flags.FADE_IN); Components.Add(scene); }
public override void Initialize(ContentManager content) { base.Initialize(content); MenuObj bg = new MenuObj("ui/mainmenu"); bg.Initialize(Content); bg.CreateFramesFromXML("ui/mainmenu_frames"); bg.CurrentFrame = "mainmenu"; bg.ResetDimensions(); float widthDif = BaseGame.Get.BackBufferWidth / 1000.0f; bg.Width *= widthDif; bg.Height *= widthDif; Components.Add(bg); Button b = new Button("ui/ui"); b.CreateFramesFromXML("ui/ui_frames"); b.Initialize(Content); b.CurrentFrame = "levelbutton"; b.ResetDimensions(); b.RegularScale = ScaleFactor * 1.5f; b.ScaleOnHover = b.RegularScale * 1.1f; b.PosX = -0.24f * BaseGame.Get.BackBufferWidth; b.PosY = -0.3f * BaseGame.Get.HalfBackBufferHeight; b.SetText("Play", "ui/Play"); b.Text.Colour = Color.Black; b.PlaySFXOnRelease = "Sounds/PlayStateSelect"; b.TextScaler = 0.75f; b.UniformScale = b.RegularScale; Components.Add(b); b = new Button("ui/ui"); b.CreateFramesFromXML("ui/ui_frames"); b.Initialize(Content); b.CurrentFrame = "settings"; b.ResetDimensions(); b.RegularScale = ScaleFactor * 0.5f; b.ScaleOnHover = b.RegularScale * 1.1f; b.PosX = -0.45f * BaseGame.Get.BackBufferWidth; b.PosY = -0.5f * BaseGame.Get.HalfBackBufferHeight; b.UniformScale = b.RegularScale; Components.Add(b); AudioManager.PlayMusic("troublemaker"); BlankNess blank = new BlankNess(); blank.Initialize(Content); blank.RaiseFlag(Flags.FADE_OUT); blank.fadeInTimer = 1.0f; blank.fullBlankity = 1.0f; Components.Add(blank); }
public override void Initialize(ContentManager content) { base.Initialize(content); blank = new BlankNess(); blank.Initialize(Content); blank.RaiseFlag(Flags.FADE_IN); blank.fullBlankity = 0.85f; blank.fadeSpeed = 4.0f; Components.Add(blank); VolumeControl v = new VolumeControl(AudioManager.MusicVolume); v.Initialize(Content); v.Name = "MusicVol"; v.CurrentVolume = AudioManager.MusicVolume; v.PosY = 100.0f * ScaleFactor; Components.Add(v); TextDrawer text = new TextDrawer("ui/LevelFont"); text.Initialize(Content); text.Text = "Music Volume"; text.Colour = Color.Gold; if (!AudioManager.IsMusicAllowed) { text.Text = "Music Disabled"; text.Colour = Color.Red; v.Disabled = true; v.CurrentVolume = 0; } text.Position = v.Position; text.UniformScale = ScaleFactor; Components.Add(text); v = new VolumeControl(AudioManager.SoundVolume); v.Initialize(Content); v.Name = "SoundVol"; v.CurrentVolume = AudioManager.SoundVolume; v.PosY = 0 * ScaleFactor; v.PlayTickWhenDone = true; Components.Add(v); text = new TextDrawer("ui/LevelFont"); text.Initialize(Content); text.Text = "Sound Volume"; text.Colour = Color.Gold; text.Position = v.Position; text.UniformScale = ScaleFactor; Components.Add(text); Button back = new Button("ui/ui"); back.Initialize(Content); back.CreateFramesFromXML("ui/ui_frames"); back.CurrentFrame = "quit"; back.ResetDimensions(); back.UniformScale = ScaleFactor * 0.001f; back.RegularScale = ScaleFactor * 0.5f; back.ScaleOnHover = ScaleFactor * 0.55f; back.Colour = Color.Red; back.Effect = BaseSprite.SpriteEffect.FLIPHORIZONTAL; back.PosX = 0.40f * BaseGame.Get.BackBufferWidth; back.PosY = 0.40f * BaseGame.Get.BackBufferHeight; back.PlaySFXOnRelease = "Sounds/PlayStateSelect"; Components.Add(back); arrowToggle = new Button("ui/ui"); arrowToggle.CreateFramesFromXML("ui/ui_frames"); arrowToggle.Initialize(Content); arrowToggle.CurrentFrame = "levelbutton"; arrowToggle.ResetDimensions(); arrowToggle.RegularScale = ScaleFactor * 1.5f; arrowToggle.ScaleOnHover = arrowToggle.RegularScale * 1.1f; arrowToggle.PosX = 0 * BaseGame.Get.BackBufferWidth; arrowToggle.PosY = -0.45f * BaseGame.Get.HalfBackBufferHeight; if(ChicksnVixensGame.Get.UseTrajectory) arrowToggle.SetText("Trajectory", "ui/Play"); else arrowToggle.SetText("Arrow", "ui/Play"); arrowToggle.Text.Colour = Color.Black; arrowToggle.PlaySFXOnRelease = "Sounds/PlayStateSelect"; arrowToggle.TextScaler = 0.65f; arrowToggle.UniformScale = arrowToggle.RegularScale; Components.Add(arrowToggle); }
public override void ProcessEvent(Event ev) { if (!IsTopScreen) { return; } base.ProcessEvent(ev); if ((ev is MenuEvent)) { if ((ev as MenuEvent).sender is Button && fader == null) { if (((ev as MenuEvent).sender as Button).Text != null) { fader = new BlankNess(); fader.Initialize(Content); fader.fullBlankity = 1.0f; fader.RaiseFlag(Flags.FADE_IN); Components.Add(fader); } else { Options p = new Options(); p.Initialize(Content); ScreenManager.Get.AddScreen(p); } } } }