public Graphics() { this.graphics = new GraphicsDeviceManager(this); this.graphics.PreferredBackBufferWidth = Convert.ToInt32(ProgramSettings.ResolutionWidth); this.graphics.PreferredBackBufferHeight = Convert.ToInt32(ProgramSettings.ResolutionHeight); this.graphics.IsFullScreen = ProgramSettings.FullscreenMode; Content.RootDirectory = "Content"; // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); screenManager.GraphicsDeviceManager = this.graphics; MultiInputManager manager = new MultiInputManager(); if (ProgramSettings.KinectEnabled && KinectHelper.Instance().isRunning()) manager.AddInputDevice(new GestureEventManager()); screenManager.OtherInput = manager; Components.Add(screenManager); // Create the first screen screenManager.AddScreen(new BackgroundScreen(), null); screenManager.AddScreen(new MainMenuScreen(), null); }
SpriteBatch spriteBatch; // this is for FPS counter #endregion Fields #region Constructors public GameMain() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "main"; #if XBOX // Create Gamer Service Component SignedInGamer.SignedOut += new EventHandler<SignedOutEventArgs>(SignedInGamer_SignedOut); GamerServicesComponent gamerServiceComp = new GamerServicesComponent(this); Components.Add(gamerServiceComp); #if DEBUG Guide.SimulateTrialMode = true; #endif #endif // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); // On Windows and Xbox we just add the initial screens AddInitialScreens(); }
/// <summary> /// The main game constructor /// </summary> public MadLabGame() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; this.TargetElapsedTime = TimeSpan.FromSeconds(1.0f / 60f); // Setup window Window.Title = "MadLab"; graphics.PreferredBackBufferWidth = GameConstants.X_RESOLUTION; graphics.PreferredBackBufferHeight = GameConstants.Y_RESOLUTION; graphics.IsFullScreen = false; graphics.ApplyChanges(); // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); // component for screenManager Components.Add(screenManager); # if(XBOX) Components.Add(new GamerServicesComponent(this)); #endif }
/// <summary> /// The main game constructor. /// </summary> public GameStateManagementGame() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); TargetElapsedTime = TimeSpan.FromTicks(333333); #if WINDOWS_PHONE graphics.IsFullScreen = true; // Choose whether you want a landscape or portait game by using one of the two helper functions. InitializeLandscapeGraphics(); // InitializePortraitGraphics(); #endif // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); #if WINDOWS_PHONE // Hook events on the PhoneApplicationService so we're notified of the application's life cycle Microsoft.Phone.Shell.PhoneApplicationService.Current.Launching += new EventHandler<Microsoft.Phone.Shell.LaunchingEventArgs>(GameLaunching); Microsoft.Phone.Shell.PhoneApplicationService.Current.Activated += new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(GameActivated); Microsoft.Phone.Shell.PhoneApplicationService.Current.Deactivated += new EventHandler<Microsoft.Phone.Shell.DeactivatedEventArgs>(GameDeactivated); #else // On Windows and Xbox we just add the initial screens AddInitialScreens(); #endif }
public Game() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; TargetElapsedTime = TimeSpan.FromTicks(333333); graphics.IsFullScreen = true; graphics.PreferredBackBufferWidth = 480; graphics.PreferredBackBufferHeight = 800; screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); screenManager = new ScreenManager(this); Components.Add(screenManager); Microsoft.Phone.Shell.PhoneApplicationService.Current.Launching += new EventHandler<Microsoft.Phone.Shell.LaunchingEventArgs>(GameLaunching); Microsoft.Phone.Shell.PhoneApplicationService.Current.Activated += new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(GameActivated); Microsoft.Phone.Shell.PhoneApplicationService.Current.Deactivated += new EventHandler<Microsoft.Phone.Shell.DeactivatedEventArgs>(GameDeactivated); }
public Game1() { // jazyk Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("cs-CZ"); this.graphics = new GraphicsDeviceManager(this); // rozmìry okna this.graphics.PreferredBackBufferWidth = 733; this.graphics.PreferredBackBufferHeight = 608; this.Content.RootDirectory = "Content"; TargetElapsedTime = TimeSpan.FromTicks(333333); // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); this.AddInitialScreens(); }
public Game() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.IsFullScreen = true; InitializeLandscapeGraphics(); // Frame rate is 30 fps by default for Windows Phone. TargetElapsedTime = TimeSpan.FromTicks(333333); // Extend battery life under lock. InactiveSleepTime = TimeSpan.FromSeconds(1); screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); screenManager = new ScreenManager(this); Components.Add(screenManager); Microsoft.Phone.Shell.PhoneApplicationService.Current.Launching += new EventHandler<Microsoft.Phone.Shell.LaunchingEventArgs>(GameLaunching); Microsoft.Phone.Shell.PhoneApplicationService.Current.Activated += new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(GameActivated); Microsoft.Phone.Shell.PhoneApplicationService.Current.Deactivated += new EventHandler<Microsoft.Phone.Shell.DeactivatedEventArgs>(GameDeactivated); }
public Game() { _graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; _graphics.PreferredBackBufferWidth = PREFERRED_WIDTH; _graphics.PreferredBackBufferHeight = PREFERRED_HEIGHT; // Krzysztoff has an ancient computer and that's why he needs manual resolution settings // If you are lucky enough to have a more powerful machine, feel free to uncomment the following lines. _graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings; #if !DEBUG _graphics.IsFullScreen = true; #endif //why was it turned off? IsFixedTimeStep = true; // disable FPS throttling _graphics.SynchronizeWithVerticalRetrace = false; _screenFactory = new ScreenFactory(); Services.AddService(typeof (IScreenFactory), _screenFactory); // Create the screen manager component. _screenManager = new ScreenManager(this); Components.Add(_screenManager); IsMouseVisible = false; AddInitialScreens(); }
public StarterGame() { // Default XNA setup. graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; // Required for lighting system. graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8; // Frame rate is 30 fps by default for Windows Phone. TargetElapsedTime = TimeSpan.FromTicks(333333); // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); //Create a new instance of the Screen Manager screenManager = new ScreenManager(this); Components.Add(screenManager); database = new SQLiteDatabase(); Instance = this; #if WINDOWS_PHONE graphics.IsFullScreen = true; // Choose whether you want a landscape or portait game by using one of the two helper functions. InitializeLandscapeGraphics(); // InitializePortraitGraphics(); #else graphics.IsFullScreen = false; #endif #if WINDOWS_PHONE // Hook events on the PhoneApplicationService so we're notified of the application's life cycle Microsoft.Phone.Shell.PhoneApplicationService.Current.Launching += new EventHandler<Microsoft.Phone.Shell.LaunchingEventArgs>(GameLaunching); Microsoft.Phone.Shell.PhoneApplicationService.Current.Activated += new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(GameActivated); Microsoft.Phone.Shell.PhoneApplicationService.Current.Deactivated += new EventHandler<Microsoft.Phone.Shell.DeactivatedEventArgs>(GameDeactivated); #else // On Windows and Xbox we just add the initial screens AddInitialScreens(); #endif // AudioManager.Initialize(this); // Required for lighting system. screenManager.splashScreenGameComponent = new SplashScreenGameComponent(this); Components.Add(screenManager.splashScreenGameComponent); }
public Game1() { //IsMouseVisible = true; Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); screenManager = new ScreenManager(this); Components.Add(screenManager); AddInitialScreen(); }
public void SetUp() { container = new Container(x => { x.For<IFixtureNodeView>().Use<FixtureNodeView>(); x.For<IScreen<IFixtureNode>>().Use<FixtureNodePresenter>(); }); factory = new ScreenFactory(container); fixture = new FixtureGraph("fixture1"); subject = new FixtureNodeSubject(fixture); thePresenter = subject.CreateScreen(factory).ShouldBeOfType<FixtureNodePresenter>(); }
public SpaceSurvivalGame() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); screenManager.AddScreen(new BackgroundScreen(), null); screenManager.AddScreen(new MainMenuScreen(), null); }
public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferHeight = 1080; graphics.PreferredBackBufferWidth = 1440; graphics.ToggleFullScreen(); Content.RootDirectory = "Content"; // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this, "Backgrounds/blank", "Fonts/menufont"); Components.Add(screenManager); AddInitialScreens(); }
/// <summary> /// The main game constructor. /// </summary> public ChessTactics() { Content.RootDirectory = "Content"; IsMouseVisible = true; graphics = new GraphicsDeviceManager(this); TargetElapsedTime = TimeSpan.FromTicks(333333); // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); // On Windows and Xbox we just add the initial screens AddInitialScreens(); }
public GameStateManagementGame(String filename) { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 768; graphics.ApplyChanges(); TargetElapsedTime = TimeSpan.FromTicks(333333); // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); IsMouseVisible = true; // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); screenManager.AddScreen(new GameplayScreen(filename), PlayerIndex.One); }
/// <summary> /// The main game constructor. /// </summary> public GameStateManagementGame() { this.Content.RootDirectory = "Content"; this.IsMouseVisible = true; this.graphics = new GraphicsDeviceManager(this); this.graphics.PreferredBackBufferWidth = 1366; this.graphics.PreferredBackBufferHeight = 768; this.graphics.IsFullScreen = true; this.TargetElapsedTime = TimeSpan.FromTicks(333333); this.Window.Title = "DeBugger by Team Kurt Vonnegut"; // Add Window Title #if WINDOWS_PHONE graphics.IsFullScreen = true; // Choose whether you want a landscape or portait game by using one of the two helper functions. InitializeLandscapeGraphics(); // InitializePortraitGraphics(); #endif // Create the screen factory and add it to the Services this.screenFactory = new ScreenFactory(); this.Services.AddService(typeof(IScreenFactory), this.screenFactory); // Create the screen manager component. this.screenManager = new ScreenManager(this); this.Components.Add(this.screenManager); #if WINDOWS_PHONE // Hook events on the PhoneApplicationService so we're notified of the application's life cycle Microsoft.Phone.Shell.PhoneApplicationService.Current.Launching += new EventHandler<Microsoft.Phone.Shell.LaunchingEventArgs>(GameLaunching); Microsoft.Phone.Shell.PhoneApplicationService.Current.Activated += new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(GameActivated); Microsoft.Phone.Shell.PhoneApplicationService.Current.Deactivated += new EventHandler<Microsoft.Phone.Shell.DeactivatedEventArgs>(GameDeactivated); #else // On Windows and Xbox we just add the initial screens this.AddInitialScreens(); #endif }
public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferHeight = 720; graphics.PreferredBackBufferWidth = 1280; Content.RootDirectory = "Content"; TargetElapsedTime = TimeSpan.FromTicks(333333); // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); // On Windows and Xbox we just add the initial screens AddInitialScreens(); }
/// <summary> /// The main game constructor. /// </summary> public GameStateManagementGame() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); //TargetElapsedTime = TimeSpan.FromTicks(333333); graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; graphics.PreferMultiSampling = true; #if !DEBUG graphics.IsFullScreen = true; #endif // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); GamerServicesComponent gamer = new GamerServicesComponent(this); Components.Add(gamer); #if DEBUG // Add the frame rate monitor // Components.Add(new FrameRateMonitor(this)); Components.Add(new FrameRateMonitor(this, false)); // don’t wait for display #endif Components.Add(new TextFader(this)); // On Windows and Xbox we just add the initial screens AddInitialScreens(); }
public T2D() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; //graphics.PreferredBackBufferWidth = 800; //graphics.PreferredBackBufferHeight = 600; graphics.ApplyChanges(); // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); Components.Add(new CompteurFPS(this)); AddInitialScreens(); }
/// <summary> /// The main game constructor. /// </summary> public Game() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferHeight = 720; graphics.PreferredBackBufferWidth = 1280; graphics.ApplyChanges ( ); // Create the screen factory and add it to the Services screenFactory = new ScreenFactory(); Services.AddService(typeof(IScreenFactory), screenFactory); // Create the screen manager component. screenManager = new ScreenManager(this); Components.Add(screenManager); netGameManager = new NetworkManager (this); Components.Add ( netGameManager ); Services.AddService ( typeof ( NetworkManager ), netGameManager ); AddInitialScreens(); }
public void SetUp() { ProjectContext context = new ProjectContext(); context.Hierarchy = DataMother.GrammarProject().LoadTests(); context.Library = DataMother.GrammarsProjectRunner().GetLibary(); UsageService service = new UsageService(context); container = new Container(x => { x.For<IFixtureNodeView>().Use<StubFixtureNodeView>(); x.For<IScreen<IFixtureNode>>().Use<FixtureNodePresenter>(); x.For<UsageService>().Use(service); }); factory = new ScreenFactory(container); fixture = context.Library.FixtureFor("Composite"); subject = new FixtureNodeSubject(fixture); thePresenter = subject.CreateScreen(factory).ShouldBeOfType<FixtureNodePresenter>(); thePresenter.Activate(null); }
public NavigationManager(SignalBus signalBus, ScreenFactory screenFactory) { _signalBus = signalBus; _screenFactory = screenFactory; }
/// <summary> /// LoadedScreenName プロパティが示す Screen をロードします。 /// このメソッドは非同期に呼び出されます。 /// </summary> /// <returns>ロードされた Screen。</returns> protected virtual Screen LoadScreen() { return(ScreenFactory.CreateScreen(LoadedScreenName)); }
private static void MainScreen() { _executionContext.CurrentScreen = ScreenFactory.CreateScreen(_render, ScreenTypeEnum.Main, new CommandModel(Text.MainScreen.DefaultBody)); }
public override Screen GoBack() { Driver.Navigate().Back(); return(ScreenFactory.CreateScreen <FragmentScreen>()); }
public override void Launch() { base.Launch(); CurrentScreen = ScreenFactory.CreateScreen <MainScreen>(); }
public ShellViewModel(ScreenFactory factory):base(factory) { }
public override void Close() { base.Close(); CurrentScreen = ScreenFactory.CreateScreen <NullApiDemoScreen>(); }
public void SetUp() { var container = new Container(x => { x.For <IScreen <Test> >().Use <StubTestScreen>(); }); factory = new ScreenFactory(container); }
/// <summary> /// Dialog events loop /// </summary> /// <param name="msg"></param> public override void HandleMessage(string msg) { msg = msg.Trim(); if (string.IsNullOrWhiteSpace(msg)) { if (status == states.WaitForConfirm) { msg = catalog.GetString("Yes"); } else if (status != states.WaitForUsername) { return; } } switch (status) { case states.WaitForUsername: string username = msg.ToUpper(); bool success = false; switch (username) { case "": client.screen = ScreenFactory.Create(client, server, "LoginScreen"); client.screen.Show(); break; case "LOGOUT": client.screen = ScreenFactory.Create(client, server, "Logout"); client.screen.Show(); return; case "GUEST": case "NEW": break; default: if (user.AcceptableUsername(username)) { using (bbsContext bbs = new bbsContext()) { User test = bbs.GetUserByUsername(username); if (test == null) { success = true; } } } break; } if (success) { user.Userid = username; LnWrite(catalog.GetString("Password") + ": "); status = states.WaitForPassword; client.inputMode = EInputMode.PasswordMode; } else { LnWrite(catalog.GetString("This name is already in use. Try another.")); LnWrite(catalog.GetString("Username") + ": "); } break; case states.WaitForPassword: password = msg; if (user.AcceptablePassword(password)) { LnWrite(catalog.GetString("Confirm password") + ": "); status = states.WaitForConfirmPassword; } else { LnWrite(catalog.GetString("Password do not meet security criteria.")); LnWrite(catalog.GetString("Password") + ": "); status = states.WaitForPassword; } break; case states.WaitForConfirmPassword: if (password == msg) { user.SetPassword(password); client.status = EClientStatus.Guest; client.inputMode = EInputMode.LineMode; LnWrite(catalog.GetString("Your real name") + ": "); status = states.WaitForRealName; } else { LnWrite(catalog.GetString("The two passwords do not match. Try again.")); LnWrite(catalog.GetString("Password") + ": "); status = states.WaitForPassword; } break; case states.WaitForRealName: user.Realname = msg; LnWrite(catalog.GetString("Your city") + ": "); status = states.WaitForCity; break; case states.WaitForCity: user.City = msg; LnWrite(catalog.GetString("Your country") + ": "); status = states.WaitForNation; break; case states.WaitForNation: user.Nation = msg; LnWrite(catalog.GetString("Confirm new user creation? [{0}]/{1}", new object[] { catalog.GetString("Yes"), catalog.GetString("No") }) + ": "); status = states.WaitForConfirm; break; case states.WaitForConfirm: msg = msg.ToUpper(); if (msg == catalog.GetString("Yes").ToUpper()) { using (bbsContext bbs = new bbsContext()) { bbs.Users.Add(user); bbs.SaveChanges(); } string m = catalog.GetString("Created new user '{0}'", user.Userid); EventLogger.Write(m, client.Remote); } client.screen = ScreenFactory.Create(client, server, "LoginScreen"); client.screen.Show(); break; default: break; } }
/// <summary> /// Shows help screen /// </summary> protected virtual void ShowHelp() { client.screen = ScreenFactory.Create(client, server, "Help", this); client.screen.Show(); }
public override Screen GoBack() { Driver.Navigate().Back(); return(ScreenFactory.CreateScreen <NullApiDemoScreen>()); }
public override Screen GoBack() { Driver.Navigate().Back(); return(ScreenFactory.CreateScreen <ActivityScreen>()); }
public void AddScreen_SetsParent() { TestScreen s = Collection.AddScreen(ScreenFactory.For <TestScreen>(Locator)); Assert.AreEqual(Parent, s.Parent); }