public static void LoadScreen(Screen screen) { NewWorld = screen; }
private static void LoadNewWorld() { if (NewWorld != Screen.Null) { if (World != null) World.DeregisterEvents(); switch (NewWorld) { case Screen.Splash: World = new Splash.World(); break; case Screen.Title: World = new Title.World(); break; case Screen.Level0: // World = new Level0.World(); break; case Screen.EndCredits: // World = new EndCredits.World(); break; } NewWorld = Screen.Null; } }
protected override void Initialize() { base.Initialize(); screen = new Screen(Registry.TypeRegistry.ResolveType<ScreenConstants>(), GraphicsDevice); GuiManager = Registry.TypeRegistry.ResolveType<GUIManager>(); input = Registry.TypeRegistry.ResolveType<InputComponent>(); Window.ClientSizeChanged += delegate { screen.WindowsResizeHandler(Window.ClientBounds.Width, Window.ClientBounds.Height); }; screen.WindowsResizeHandler(Window.ClientBounds.Width, Window.ClientBounds.Height); Registry.StartModule("GameEngine", this); Registry.StartModule(startModule, this); if (Graphic == null) throw new InvalidOperationException("Graphic component is not set"); Graphic.Setup(); GuiManager.Setup(); }