/// <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; }
public WorldManager(Viewport viewport, Level level) { Level = level; GeneratePlayer(); Camera = GameCore.Camera.CreateOrthographicCamera(viewport); _chunkRenderer = new ChunkRenderer(viewport); }
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>(); }
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 }; }
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>(); }
public override void Resize(Viewport viewport) { base.Resize(viewport); _hudCamera.Resize(viewport); }
public static Camera<OrthographicProjection> CreateOrthographicCamera(Viewport viewport) { return new Camera<OrthographicProjection>(new OrthographicProjection(viewport)); }
public static Camera<PerspectiveProjection> CreatePerspectiveCamera(Viewport viewport) { return new Camera<PerspectiveProjection>(new PerspectiveProjection(viewport)); }
MainCore() { Viewport = new Viewport(300, 300, 0, 0); StarSystems.Add(new StarSystem(3)); CreatePlayers(); }
public void Resize(Viewport viewport) { _hudCamera.Resize(viewport); }
public ChunkRenderer(Viewport viewport) { _tessellator = new VertexBufferTessellator() { Mode = VertexTessellatorMode.Render }; }
public override void Resize(Viewport viewport) { base.Resize(viewport); _worldManager.Resize(viewport); _uiManager.Resize(viewport); }