예제 #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;
		}
예제 #2
0
		public WorldManager(Viewport viewport, Level level)
		{
			Level = level;

			GeneratePlayer();

			Camera = GameCore.Camera.CreateOrthographicCamera(viewport);
			_chunkRenderer = new ChunkRenderer(viewport);
		}
예제 #3
0
		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>();
		}
예제 #4
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 };
		}
예제 #5
0
		public UIManager(IGameWindow window, Viewport viewport, WorldManager worldManager)
		{
			_window = window;

			_worldManager = worldManager;

			_children = new List<UIElement>();

			_hudCamera = Camera.CreateOrthographicCamera(viewport);
			_hudCamera.Projection.OrthographicSize = viewport.Height / 2;

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

			ToolbarItems = new List<ItemStackButton>();
		}
예제 #6
0
		public override void Resize(Viewport viewport)
		{
			base.Resize(viewport);
			_hudCamera.Resize(viewport);
		}
예제 #7
0
		public static Camera<OrthographicProjection> CreateOrthographicCamera(Viewport viewport)
		{
			return new Camera<OrthographicProjection>(new OrthographicProjection(viewport));
		}
예제 #8
0
		public static Camera<PerspectiveProjection> CreatePerspectiveCamera(Viewport viewport)
		{
			return new Camera<PerspectiveProjection>(new PerspectiveProjection(viewport));
		}
예제 #9
0
 MainCore() {
     Viewport = new Viewport(300, 300, 0, 0);
     StarSystems.Add(new StarSystem(3));
     CreatePlayers();
 }
예제 #10
0
		public void Resize(Viewport viewport)
		{
			_hudCamera.Resize(viewport);
		}
예제 #11
0
		public ChunkRenderer(Viewport viewport)
		{
			_tessellator = new VertexBufferTessellator() { Mode = VertexTessellatorMode.Render };
		}
예제 #12
0
		public override void Resize(Viewport viewport)
		{
			base.Resize(viewport);
			_worldManager.Resize(viewport);
			_uiManager.Resize(viewport);
		}