コード例 #1
0
        public override bool Equals(BackgroundScreen other)
        {
            var backgroundScreenCustom = other as BackgroundScreenCustom;
            if (backgroundScreenCustom == null) return false;

            return base.Equals(other) && textureName == backgroundScreenCustom.textureName;
        }
コード例 #2
0
ファイル: GameWorld.cs プロジェクト: scastle/Solitude
        /// <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());
        }
コード例 #3
0
        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());
        }
コード例 #4
0
        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(); },
                        }
                    }
                }
            };
        }
コード例 #5
0
ファイル: Game1.cs プロジェクト: armangharib/Swarm
        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();
        }
コード例 #6
0
        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);
        }
コード例 #7
0
ファイル: App1.cs プロジェクト: armangharib/Swarm
        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();
        }
コード例 #8
0
        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;
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
ファイル: BackgroundScreenCustom.cs プロジェクト: Wieku/osu
        public override bool Equals(BackgroundScreen other)
        {
            if (other is BackgroundScreenCustom backgroundScreenCustom)
            {
                return(base.Equals(other) && textureName == backgroundScreenCustom.textureName);
            }

            return(false);
        }
コード例 #12
0
ファイル: Game1.cs プロジェクト: grzdrz/gms
        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)));
        }
コード例 #13
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);
        }
コード例 #14
0
        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);
        }
コード例 #15
0
ファイル: BackgroundScreenBeatmap.cs プロジェクト: mist9/osu
        public override bool Equals(BackgroundScreen other)
        {
            var otherBeatmapBackground = other as BackgroundScreenBeatmap;

            if (otherBeatmapBackground == null)
            {
                return(false);
            }

            return(base.Equals(other) && beatmap == otherBeatmapBackground.Beatmap);
        }
コード例 #16
0
        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);
            }
        }
コード例 #17
0
        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);
            }
        }
コード例 #18
0
        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);
        }
コード例 #19
0
 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();
         //}
     }
 }
コード例 #20
0
        //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);
            }
        }
コード例 #21
0
        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);
        }
コード例 #22
0
ファイル: Game1.cs プロジェクト: nhotwn/Swarm
        /// <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();
        }
コード例 #23
0
        /// <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);
        }
コード例 #24
0
        /// <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);
        }
コード例 #25
0
 public override bool Equals(BackgroundScreen other)
 {
     return(base.Equals(other) && textureName == ((BackgroundScreenCustom)other).textureName);
 }
コード例 #26
0
        /// <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);
        }
コード例 #27
0
ファイル: BackgroundScreenBeatmap.cs プロジェクト: revam/osu
 public override bool Equals(BackgroundScreen other)
 {
     return(base.Equals(other) && beatmap == ((BackgroundScreenBeatmap)other).Beatmap);
 }
コード例 #28
0
ファイル: MainMenuScreen.cs プロジェクト: elixir67/Sandbox
 /// 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);
 }