public override bool Equals(BackgroundScreen other) { var backgroundScreenCustom = other as BackgroundScreenCustom; if (backgroundScreenCustom == null) return false; return base.Equals(other) && textureName == backgroundScreenCustom.textureName; }
/// <summary> /// Loads the sprites and audio. /// </summary> protected override void LoadContent() { content = Content; graphics = GraphicsDevice; graphics.PresentationParameters.BackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; graphics.PresentationParameters.BackBufferHeight = (int)(0.5625f * GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width); #if !XBOX graphics.PresentationParameters.IsFullScreen = false; #endif gameSaver = new GameSaver("Project290", new bool[] { true, true, true, true, true, true, true, true, true, true, true, true, true }); audio = new AudioManager(this); Loader.LoadShared(); Loader.LoadSolitudeContent(); Loader.LoadGameInfo(); // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); Drawer.Initiallize(); background = new BackgroundScreen(); screens.Play(new StartScreen()); }
private void load() { Window.WindowBorder = WindowBorder.Hidden; Window.Title = "The Cursed Constellations Installer"; Window.Size = new Size(1600, 900); Resources.AddStore(new DllResourceStore(mainResourceFile)); largeTextureStore = new LargeTextureStore(Host.CreateTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures"))); largeTextureStore.AddStore(Host.CreateTextureLoaderStore(new OnlineStore())); dependencies.Cache(largeTextureStore); // Fonts AddFont(Resources, @"Fonts/Ageo-Light"); AddFont(Resources, @"Fonts/Ageo-LightItalic"); AddFont(Resources, @"Fonts/Ageo-Medium"); AddFont(Resources, @"Fonts/Ageo-Regular"); AddFont(Resources, @"Fonts/Ageo-RegularItalic"); AddFont(Resources, @"Fonts/Ageo-Thin"); installerScreenStack = new ScreenStack(); installerScreenStack.RelativeSizeAxes = Axes.Both; Add(installerScreenStack); installerScreenStack.Push(backgroundScreen = new BackgroundScreen()); }
public MainMenu() { background = new BackgroundScreenDefault(); Children = new Drawable[] { new ParallaxContainer { ParallaxAmount = 0.01f, Children = new Drawable[] { buttons = new ButtonSystem { OnChart = delegate { Push(new ChartListing()); }, OnDirect = delegate { Push(new OnlineListing()); }, OnEdit = delegate { Push(new Editor()); }, OnSolo = delegate { Push(consumeSongSelect()); }, OnMulti = delegate { Push(new Lobby()); }, OnTest = delegate { Push(new TestBrowser()); }, OnExit = delegate { Exit(); }, } } } }; }
protected override void Initialize() { ScreenManager screenManager = new ScreenManager(this); this.Components.Add(screenManager); var backgroundscreen = new BackgroundScreen(); screenManager.AddScreen(backgroundscreen); var debugScreen = new DebugScreen(screenManager, false); screenManager.Game.Components.Add(debugScreen); this.Services.AddService(typeof(IDebugScreen), debugScreen); //Recipe[] recipes = new Recipe[1]; //recipes[0] = new Recipe(StockRecipies.Stable_A); PopulationSimulator populationSimulator = new PopulationSimulator(0, 0); var swarmEmitterComponent = new SwarmEmitterComponent(populationSimulator); var swarmAnalysisComponent = new SwarmAnalysisComponent(this.Services.GetService(typeof(IDebugScreen)) as IDebugScreen); SwarmScreen1 swarmScreen = new SwarmScreen1(swarmEmitterComponent, swarmAnalysisComponent, populationSimulator); screenManager.AddScreen(swarmScreen); #if NETFX_CORE ControlClient controlClient = new ControlClient(swarmScreen, this.Services.GetService(typeof(IAudio)) as IAudio); #else ControlClient controlClient = new ControlClient(swarmScreen)); #endif this.Services.AddService(typeof(IControlClient), controlClient); base.Initialize(); //SoundEngine.Init(); }
void backToMenuSelected(object sender, PlayerIndexEventArgs e) { GameScreen[] screenToLoad; if (this.gameMode == GameplayScreen.GameMode.SCORE_ATTACK) { screenToLoad = new GameScreen[3]; screenToLoad[0] = new BackgroundScreen(true); screenToLoad[1] = new MainMenuScreen(); screenToLoad[2] = new ScoreAttackSelectionScreen(); } else if (this.gameMode == GameplayScreen.GameMode.CHALLENGE_MODE) { screenToLoad = new GameScreen[3]; screenToLoad[0] = new BackgroundScreen(true); screenToLoad[1] = new MainMenuScreen(); screenToLoad[2] = new ChallengeModeDifficultySelectionScreen(); } else { screenToLoad = new GameScreen[1]; screenToLoad[0] = new BackgroundScreen(); } LoadingScreen.Load(ScreenManager, false, e.PlayerIndex, screenToLoad); }
protected override void Initialize() { SetWindowOnSurface(); ScreenManager screenManager = new ScreenManager(this); this.Components.Add(screenManager); var backgroundscreen = new BackgroundScreen(); screenManager.AddScreen(backgroundscreen); var debugScreen = new DebugScreen(screenManager, false); screenManager.Game.Components.Add(debugScreen); this.Services.AddService(typeof(IDebugScreen), debugScreen); PopulationSimulator populationSimulator = new PopulationSimulator(0, 0); var swarmEmitterComponent = new SwarmEmitterComponent(populationSimulator); var swarmAnalysisComponent = new SwarmAnalysisComponent(this.Services.GetService(typeof(IDebugScreen)) as IDebugScreen); SwarmScreen1 swarmScreen = new SwarmScreen1(swarmEmitterComponent, swarmAnalysisComponent, populationSimulator); screenManager.AddScreen(swarmScreen); ControlClient controlClient = new ControlClient(swarmScreen, swarmAnalysisComponent); this.Services.AddService(typeof(IControlClient), controlClient); base.Initialize(); SoundEngine.Init(); }
public override void LoadContent() { base.LoadContent(); if (backgroundTextureStr != null) { background = new BackgroundScreen("Materials/ground"); this.ScreenManager.AddScreen(background); this.AttachScreen(background); } base.DebugView = new DebugViewXNA(World); DebugView.AppendFlags(DebugViewFlags.Shape); DebugView.AppendFlags(DebugViewFlags.DebugPanel); DebugView.AppendFlags(DebugViewFlags.PerformanceGraph); DebugView.AppendFlags(DebugViewFlags.Joint); DebugView.AppendFlags(DebugViewFlags.ContactPoints); DebugView.AppendFlags(DebugViewFlags.ContactNormals); DebugView.AppendFlags(DebugViewFlags.Controllers); DebugView.AppendFlags(DebugViewFlags.CenterOfMass); DebugView.AppendFlags(DebugViewFlags.AABB); DebugView.DefaultShapeColor = Color.White; DebugView.SleepingShapeColor = Color.LightGray; DebugView.LoadContent(ScreenManager.GraphicsDevice, ScreenManager.Content); DebugView.Enabled = false; }
void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { GameScreen[] screenToLoad = new GameScreen[3]; screenToLoad[0] = new BackgroundScreen(true); screenToLoad[1] = new MainMenuScreen(); LoadingScreen.Load(ScreenManager, false, null, screenToLoad); }
void ConfirmChallengeSelected(object sender, PlayerIndexEventArgs e) { GameScreen[] screensToLoad = new GameScreen[2]; screensToLoad[0] = new BackgroundScreen(true, true); screensToLoad[1] = new ChallengeModeScreen(currentlySelectedChallenge, e.PlayerIndex); LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, screensToLoad); }
public override bool Equals(BackgroundScreen other) { if (other is BackgroundScreenCustom backgroundScreenCustom) { return(base.Equals(other) && textureName == backgroundScreenCustom.textureName); } return(false); }
protected override void Initialize() { base.Initialize(); GameLevel simpleTest = new GameLevel(); GameLevel1 gameLevel1 = new GameLevel1(); SimpleDemo1 simpleDemo1 = new SimpleDemo1(); SimpleDemo2 simpleDemo2 = new SimpleDemo2(); SimpleDemo3 simpleDemo3 = new SimpleDemo3(); SimpleDemo4 simpleDemo4 = new SimpleDemo4(); SimpleDemo5 simpleDemo5 = new SimpleDemo5(); SimpleDemo6 simpleDemo6 = new SimpleDemo6(); SimpleDemo7 simpleDemo7 = new SimpleDemo7(); SimpleDemo8 simpleDemo8 = new SimpleDemo8(); SimpleDemo9 simpleDemo9 = new SimpleDemo9(); SimpleDemo10 simpleDemo10 = new SimpleDemo10(); AdvancedDemo1 advancedDemo1 = new AdvancedDemo1(); AdvancedDemo2 advancedDemo2 = new AdvancedDemo2(); AdvancedDemo3 advancedDemo3 = new AdvancedDemo3(); AdvancedDemo4 advancedDemo4 = new AdvancedDemo4(); AdvancedDemo5 advancedDemo5 = new AdvancedDemo5(); MenuScreen menuScreen = new MenuScreen("Samples"); menuScreen.AddMenuItem(simpleTest.GetTitle(), EntryType.Screen, simpleTest, "1"); menuScreen.AddMenuItem(gameLevel1.GetTitle(), EntryType.Screen, gameLevel1, "2"); menuScreen.AddMenuItem(simpleDemo1.GetTitle(), EntryType.Screen, simpleDemo1, "3"); menuScreen.AddMenuItem(simpleDemo2.GetTitle(), EntryType.Screen, simpleDemo2, "4"); menuScreen.AddMenuItem(simpleDemo3.GetTitle(), EntryType.Screen, simpleDemo3, "5"); menuScreen.AddMenuItem(simpleDemo4.GetTitle(), EntryType.Screen, simpleDemo4, "6"); menuScreen.AddMenuItem(simpleDemo5.GetTitle(), EntryType.Screen, simpleDemo5, "7"); menuScreen.AddMenuItem(simpleDemo6.GetTitle(), EntryType.Screen, simpleDemo6, "8"); menuScreen.AddMenuItem(simpleDemo7.GetTitle(), EntryType.Screen, simpleDemo7, "9"); menuScreen.AddMenuItem(simpleDemo8.GetTitle(), EntryType.Screen, simpleDemo8, "10"); menuScreen.AddMenuItem(simpleDemo9.GetTitle(), EntryType.Screen, simpleDemo9, "11"); menuScreen.AddMenuItem(simpleDemo10.GetTitle(), EntryType.Screen, simpleDemo10, "12"); menuScreen.AddMenuItem(advancedDemo1.GetTitle(), EntryType.Screen, advancedDemo1, "13"); menuScreen.AddMenuItem(advancedDemo2.GetTitle(), EntryType.Screen, advancedDemo2, "14"); menuScreen.AddMenuItem(advancedDemo3.GetTitle(), EntryType.Screen, advancedDemo3, "15"); menuScreen.AddMenuItem(advancedDemo4.GetTitle(), EntryType.Screen, advancedDemo4, "16"); menuScreen.AddMenuItem(advancedDemo5.GetTitle(), EntryType.Screen, advancedDemo5, "17"); menuScreen.AddMenuItem("", EntryType.Separator, null, ""); menuScreen.AddMenuItem("Exit", EntryType.ExitItem, null, ""); MainMenuScreen mainMenuScreen = new MainMenuScreen("MainMenu"); mainMenuScreen.AddMenuItem(EntryType.Screen, menuScreen); mainMenuScreen.AddMenuItem(EntryType.ExitItem, null); ScreenManager.AddScreen(background = new BackgroundScreen()); ScreenManager.AddScreen(mainMenuScreen); ScreenManager.AddScreen(new LogoScreen(TimeSpan.FromSeconds(3.0))); }
void HardEntrySelected(object sender, PlayerIndexEventArgs e) { Hard hardDiff = new Hard(); GameScreen[] screensToLoad = new GameScreen[2]; screensToLoad[0] = new BackgroundScreen(true, true); screensToLoad[1] = new ScoreAttackScreen(hardDiff, e.PlayerIndex); LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, screensToLoad); }
void ImpossibleEntrySelected(object sender, PlayerIndexEventArgs e) { Impossible impDiff = new Impossible(); GameScreen[] screensToLoad = new GameScreen[2]; screensToLoad[0] = new BackgroundScreen(true, true); screensToLoad[1] = new ScoreAttackScreen(impDiff, e.PlayerIndex); LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, screensToLoad); }
public override bool Equals(BackgroundScreen other) { var otherBeatmapBackground = other as BackgroundScreenBeatmap; if (otherBeatmapBackground == null) { return(false); } return(base.Equals(other) && beatmap == otherBeatmapBackground.Beatmap); }
void backToMenuSelected(object sender, PlayerIndexEventArgs e) { if (acceptingInput) { GameScreen[] screensToLoad = new GameScreen[3]; screensToLoad[0] = new BackgroundScreen(true); screensToLoad[1] = new MainMenuScreen(); LoadingScreen.Load(ScreenManager, false, null, screensToLoad); } }
void playAgainSelected(object sender, PlayerIndexEventArgs e) { if (acceptingInput) { GameScreen[] screensToLoad = new GameScreen[3]; screensToLoad[0] = new BackgroundScreen(true, true); screensToLoad[1] = new BattleModeScreen((PlayerIndex)playerIndex1, (PlayerIndex)playerIndex2); LoadingScreen.Load(ScreenManager, false, null, screensToLoad); } }
public override bool Equals(BackgroundScreen other) { var backgroundScreenCustom = other as BackgroundScreenCustom; if (backgroundScreenCustom == null) { return(false); } return(base.Equals(other) && texture == backgroundScreenCustom.texture || base.Equals(other) && textureName == backgroundScreenCustom.textureName); }
private void MatchForm_FormClosing(object sender, FormClosingEventArgs e) { if (!authenticationSuccess) { LoginForm loginFormObj = new LoginForm(); BackgroundScreen.loginFormReload(loginFormObj); this.Hide(); Application.Restart(); //if (ScreenLock.LoginForm.loginFormStaticObject != null) //{ // ScreenLock.LoginForm.loginFormStaticObject.Show(); //} } }
//Detect when window changes and see if it's the trade menu private void OnWindowChange(object sender, System.EventArgs e) { var inventoryWindow = uiManager.TopWindow as DaggerfallTradeWindow; if (inventoryWindow != null && tradeBackgroundScreen.window != inventoryWindow) { var inventoryPaperDoll = (PaperDoll)GetFieldValue("paperDoll", inventoryWindow); tradeBackgroundScreen.UpdateWindow(inventoryWindow, inventoryPaperDoll); tradeBackgroundScreen.UpdateCurrentTexture(); } else { inventoryBackgroundScreen = new BackgroundScreen(inventoryBackgroundScreen.window, inventoryBackgroundScreen.paperDoll); } }
private void Start() { var inventoryWindow = (DaggerfallInventoryWindow)GetFieldValue("dfInventoryWindow", DaggerfallUI.Instance); var inventoryPaperDoll = (PaperDoll)GetFieldValue("paperDoll", inventoryWindow); inventoryBackgroundScreen = new BackgroundScreen(inventoryWindow, inventoryPaperDoll); var characterSheetWindow = (DaggerfallCharacterSheetWindow)GetFieldValue("dfCharacterSheetWindow", DaggerfallUI.Instance); var characterSheetPaperDoll = (PaperDoll)GetFieldValue("characterPortrait", characterSheetWindow); characterSheetBackgroundScreen = new BackgroundScreen(characterSheetWindow, characterSheetPaperDoll); uiManager = (UserInterfaceManager)GetFieldValue("uiManager", DaggerfallUI.Instance); uiManager.OnWindowChange += OnWindowChange; //Create container for trade window tradeBackgroundScreen = new BackgroundScreen(null, null); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { ScreenManager screenManager = new ScreenManager(this); this.Components.Add(screenManager); var backgroundscreen = new BackgroundScreen(); screenManager.AddScreen(backgroundscreen); var debugScreen = new DebugScreen(screenManager, false); screenManager.Game.Components.Add(debugScreen); this.Services.AddService(typeof(IDebugScreen), debugScreen); SwarmScreen1 swarmScreen = new SwarmScreen1(StockRecipies.Stable_A, false); screenManager.AddScreen(swarmScreen); base.Initialize(); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { elapsedTime += gameTime.ElapsedGameTime; if (elapsedTime > TimeSpan.FromSeconds(1)) { elapsedTime -= TimeSpan.FromSeconds(1); screenManager.FPS = frameCounter; frameCounter = 0; } if (!menuInit) { /////////////////////GO TO MAIN MENU/////////////////// backgroundScreen = new BackgroundScreen(); splashtimer += 1; if (splashtimer > 10) { screenManager.AddScreen(backgroundScreen); screenManager.AddScreen(new MainMenuScreen(screenManager)); MediaPlayer.Volume = screenManager.Settings.MusicVolumeAmount; if (screenManager.Settings.InGameMusic && !ingamemusicloaded) { MediaPlayer.IsRepeating = true; MediaPlayer.Play(screenManager.BackgroundMusic); ingamemusicloaded = true; } menuInit = true; splashisup = false; } } base.Update(gameTime); }
/// <summary> /// Pause the current game /// </summary> private void PauseCurrentGame() { var pauseMenuBackground = new BackgroundScreen(); if (isDragging) { isDragging = false; player.Catapult.CurrentState = CatapultState.Idle; } ScreenManager.AddScreen(pauseMenuBackground, null); ScreenManager.AddScreen(new PauseScreen(pauseMenuBackground, player, computer), null); }
public override bool Equals(BackgroundScreen other) { return(base.Equals(other) && textureName == ((BackgroundScreenCustom)other).textureName); }
/// <summary> /// Updates the splash screen. /// </summary> public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { // Update mirror Viewport viewport = ScreenManager.Viewport; mirrorCamera.Update(gameTime, new Vector2(viewport.Width / 2 * 0.7f, viewport.Height / 2), viewport); mirrorCamera.Shake(1000, 1f); // Update alpha for press start string alpha += alphaIncrement; if (alpha > 1) { alpha = 1; alphaIncrement *= -1; } else if (alpha < 0) { alpha = 0; alphaIncrement *= -1; } if (pressed) { this.ExitScreen(); if (bgm != null) bgm.Stop(AudioStopOptions.Immediate); BackgroundScreen bgScreen = new BackgroundScreen(); ScreenManager.AddScreen(bgScreen, null); ScreenManager.AddScreen(new MainMenuScreen(bgScreen), null); pressed = false; } base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); }
public override bool Equals(BackgroundScreen other) { return(base.Equals(other) && beatmap == ((BackgroundScreenBeatmap)other).Beatmap); }
/// Handles "Select Background Music" menu item selection /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void SelectBackgroundMusicMenuEntrySelected(object sender, EventArgs e) { var backgroundScreen = new BackgroundScreen(); ScreenManager.AddScreen(backgroundScreen, null); ScreenManager.AddScreen(new MusicSelectionScreen(backgroundScreen), null); }