Example #1
0
		/// <param name="closeOnFocus">Should this state close when the game receives input focus?</param>
		public PauseState(GameStateManager manager)
			: base(manager)
		{
			var viewport = new Viewport(0, 0, manager.GameWindow.Width, manager.GameWindow.Height);
			_tessellator = new VertexBufferTessellator() { Mode = VertexTessellatorMode.Render };
			_hudCamera = Camera.CreateOrthographicCamera(viewport);
			_hudCamera.Projection.OrthographicSize = viewport.Height / 2;
		}
Example #2
0
		public GameState(GameStateManager manager)
			: base(manager.GameWindow)
		{
			Manager = manager;

			IsUpdateable = true;
			IsRenderable = true;
		}
		public LoadWorldGameState(GameStateManager manager)
			: base(manager)
		{
			var viewport = new Viewport(0, 0, manager.GameWindow.Width, manager.GameWindow.Height);
			_hudCamera = Camera.CreateOrthographicCamera(viewport);
			_hudCamera.Projection.OrthographicSize = viewport.Height / 2;
			_tessellator = new VertexBufferTessellator() { Mode = VertexTessellatorMode.Render };

			_progressMessages = new ConcurrentStack<string>();
		}
Example #4
0
		public BasicGameWindow(int width, int height, string title, Icon icon, string contentRootPath)
			: base(width, height, new GraphicsMode(new ColorFormat(32), 1, 0, 4, new ColorFormat(32), 2), title)
		{
			Icon = icon;
			Content = new ContentManager(contentRootPath);
			States = new GameStateManager(this, Content);

			InputManager.Initialize(this);

			Load += BasicGameWindow_Load;
			Resize += BasicGameWindow_Resize;
			UpdateFrame += BasicGameWindow_UpdateFrame;
			RenderFrame += BasicGameWindow_RenderFrame;
		}
Example #5
0
		public GameplayState(GameStateManager manager, Level level)
			: base(manager)
		{
			var viewport = new Viewport(0, 0, manager.GameWindow.Width, manager.GameWindow.Height);

			_frameCount = 0;
			_totalGameTime = TimeSpan.Zero;
			_timer = Stopwatch.StartNew();

			_worldManager = new WorldManager(viewport, level);
			_uiManager = new UIManager(manager.GameWindow, viewport, _worldManager);

			_tessellator = new VertexBufferTessellator() { Mode = VertexTessellatorMode.Render };
		}