private static void DisplayAsync() { string text = Story.TransitionTexts[_mapLevel - 1]; _UIConsole.Resize(_screenWidth, _screenHeight); _UIConsole.Clear(); _UIConsole.SetChar(1, 5, '_'); int i = 1; int j = 5; foreach (char letter in text) { _UIConsole.SetChar(i, j, letter); _UIConsole.SetChar(i + 1, j, '_'); RLConsole.Blit(_UIConsole, 0, 0, _UIConsole.Width, _UIConsole.Height, _rootConsole, 0, 0); _rootConsole.Draw(); if (letter == '.') { Thread.Sleep(500); } Thread.Sleep(Dice.Roll("3D30")); i++; if (i >= _UIConsole.Width - 3) { _UIConsole.SetChar(i, j, ' '); j += 2; i = 1; } } Thread.Sleep(1000); }
protected override void DisplayInternal(RLConsole console, IDataRogueControl control, ISystemContainer systemContainer, List <MapCoordinate> playerFov) { var mapConsole = new RLConsole(control.Position.Width, control.Position.Height); mapConsole.Clear(); var cameraPosition = systemContainer.RendererSystem.CameraPosition; var currentMap = systemContainer.MapSystem.MapCollection[cameraPosition.Key]; var cameraX = cameraPosition.X; var cameraY = cameraPosition.Y; var consoleWidth = mapConsole.Width; var consoleHeight = mapConsole.Height; int offsetX = consoleWidth / 2; int offsetY = consoleHeight / 2; for (int y = 0; y < consoleHeight; y++) { for (int x = 0; x < consoleWidth; x++) { var lookupX = cameraX - offsetX + x; var lookupY = cameraY - offsetY + y; MapRendererHelper.DrawCell(mapConsole, x, y, systemContainer.PositionSystem, currentMap, lookupX, lookupY, playerFov); } } RLConsole.Blit(mapConsole, 0, 0, mapConsole.Width, mapConsole.Height, console, control.Position.Left, control.Position.Top); }
private static void OnRootConsoleRender(object sender, UpdateEventArgs e) { // update render systems if (_renderRequired) { _mapConsole.Clear(); _statConsole.Clear(); _messageConsole.Clear(); //DungeonMap.UpdateDrawFOV(EntityManager); DungeonMap.Draw(_mapConsole); RenderSystem.Update(_mapConsole, _statConsole); MessageLog.Draw(_messageConsole); //blit subconsoles RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight); RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0); RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight); RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0); // tell RLNET to draw console _rootConsole.Draw(); _renderRequired = false; } }
// Event handler for RLNET's Render event private static void OnRootConsoleRender(object sender, UpdateEventArgs e) { if (_renderRequired) { // Clear the consoles for a new level _mapConsole.Clear(); _statConsole.Clear(); _messageConsole.Clear(); _inventoryConsole.Clear(); // Draw everything to the map DungeonMap.Draw(_mapConsole, _statConsole); Player.Draw(_mapConsole, DungeonMap); Player.DrawStats(_statConsole, _statWidth, _statHeight); Player.DrawInventory(_inventoryConsole); MessageLog.Draw(_messageConsole, _messageWidth, _messageHeight); // Blit the sub consoles to the root console in the correct locations RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight); RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight); RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0); RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0); // Tell RLNET to draw the console that we set _rootConsole.Draw(); _renderRequired = false; } }
private static void OnRootConsoleRender(object sender, UpdateEventArgs e) { if (_renderRequired) { _mapConsole.Clear(); _statConsole.Clear(); _messageConsole.Clear(); DungeonMap.Draw(_mapConsole, _statConsole); Player.Draw(_mapConsole, DungeonMap); MessageLog.Draw(_messageConsole); Player.DrawStats(_statConsole); RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight); RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0); RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight); RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0); _rootConsole.Draw(); _renderRequired = false; } }
private static void RootConsole_Render(object sender, UpdateEventArgs e) { if (_renderRequired) { mazmorraConsole.Clear(); estadisticaConsole.Clear(); mensajeConsole.Clear(); DungeonMap.Draw(mazmorraConsole, estadisticaConsole); Player.Draw(mazmorraConsole, DungeonMap); Player.DrawStats(estadisticaConsole); MessageLog.Draw(mensajeConsole); RLConsole.Blit(mazmorraConsole, 0, 0, mazmorraWidth, mazmorraHeight, rootConsole, 0, inventarioHeight); RLConsole.Blit(estadisticaConsole, 0, 0, estadisticasWidth, estadisticasHeight, rootConsole, mazmorraWidth, 0); RLConsole.Blit(mensajeConsole, 0, 0, mensajeWidth, mensajeHeight, rootConsole, 0, screenHeight - mensajeHeight); RLConsole.Blit(inventarioConsole, 0, 0, inventarioWidth, inventarioHeight, rootConsole, 0, 0); rootConsole.Draw(); _renderRequired = false; } }
// Event handler for RLNET's Render event private static void OnRootConsoleRender(object sender, UpdateEventArgs e) { //don't redraw consoles if nothing changes if (_renderRequired) { _mapConsole.Clear(); _statConsole.Clear(); _messageConsole.Clear(); _inventoryConsole.Clear(); DungeonMap.Draw(_mapConsole, _statConsole); //draw the player Player.Draw(_mapConsole, DungeonMap); //draw the status console Player.DrawStats(_statConsole); //draw the MessageLog MessageLog.Draw(_messageConsole); //Blit the sub consoles to the root console in the correct locations RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight); RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0); RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight); RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0); //tell RLNet to draw the console _rootConsole.Draw(); _renderRequired = false; } }
// Event handler for Render event private static void OnRootConsoleRender(object sender, UpdateEventArgs e) { //dont want to redraw all the time for no reason if (_renderRequired) { //clear all _mapConsole.Clear(); _statConsole.Clear(); _messageConsole.Clear(); // draw the map, this has to be first i think DungeonMap.Draw(_mapConsole, _statConsole); Player.Draw(_mapConsole, DungeonMap); Player.DrawStats(_statConsole); MessageLog.Draw(_messageConsole); //combine all the smaller consoles to the main one RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight); RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0); RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight); RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0); //draw main console _rootConsole.Draw(); _renderRequired = false; } }
// Event handler for RLNET's Render event private static void OnRootConsoleRender(object sender, UpdateEventArgs e) { if (_renderRequired) { _mapConsole.Clear(); _statConsole.Clear(); _messageConsole.Clear(); DungeonMap.Draw(_mapConsole, _statConsole); Player.Draw(_mapConsole, DungeonMap); Player.DrawStats(_statConsole); MessageLog.Draw(_messageConsole); // Blit the sub consoles to the root console in the correct locations RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight); RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0); RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight); RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0); // Tell RLNET to draw the console that we set _rootConsole.Draw(); // Don't bother redrawing all of the consoles if nothing has changed. _renderRequired = false; } }
public void Draw(RLConsole mapConsole, RLConsole statConsole, RLConsole inventoryConsole) { mapConsole.Clear(); foreach (Cell cell in GetAllCells()) { SetConsoleSymbolForCell(mapConsole, cell); } int i = 0; foreach (Monster monster in _monsters) { monster.Draw(mapConsole, this); if (IsInFov(monster.X, monster.Y)) { monster.DrawStats(statConsole, i); i++; } } foreach (Door door in Doors) { door.Draw(mapConsole, this); } StairsUp.Draw(mapConsole, this); StairsDown.Draw(mapConsole, this); }
private static void ClearConsoles() { mapConsole.Clear(); Stats.Clear(); Messages.Clear(); QuickBar.Clear(); }
// Event handler for RLNET's Render event private static void OnRootConsoleRender(object sender, UpdateEventArgs e) { if (_renderRequired) { _mapConsole.Clear(); _statConsole.Clear(); _messageConsole.Clear(); DungeonMap.Draw(_mapConsole, _statConsole); Player.Draw(_mapConsole); Player.DrawStats(_statConsole); MessageLog.Draw(_messageConsole); if (!Globals.BuildingEntranceIsTriggered && !Globals.IsPlayerDead && !Globals.IsBossDead) { // Blit the sub consoles to the root console in the correct locations RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, 0); RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0); RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight); } else if (Globals.BuildingEntranceIsTriggered) { if (Globals.SheriffTriggered) { QuestMenu.CreateQuestMenu(_rootConsole); } else if (Globals.GenericMenuTriggered) { Menu.CreateMenu(_rootConsole); } else { Globals.BuildingEntranceIsTriggered = false; } } else if (Globals.IsBossDead) { WinMenu.CreateWinScreen(_rootConsole); } else if (Globals.IsPlayerDead) { if (Player.Health <= 0) { DeathScreen.CreateDeathScreen(_rootConsole); } else { Globals.IsPlayerDead = false; } } // Tell RLNET to draw the console that we set _rootConsole.Draw(); _renderRequired = false; } }
// The Draw method will be called each time the map is updated // It will render all of the symbols/colors for each cell to the map sub console public void Draw(RLConsole mapConsole) { mapConsole.Clear(); foreach (Cell cell in GetAllCells()) { SetConsoleSymbolForCell(mapConsole, cell); } }
//Event handler for RLNet render event private static void OnRootConsoleRender(object Sender, UpdateEventArgs e) { if (renderRequired) { mapConsole.Clear(); statsConsole.Clear(); inventoryConsole.Clear(); armourConsole.Clear(); statsConsole.SetBackColor(0, 0, statsWidth, statsHeight, Palette.AlternateLightest); statsConsole.Print(1, 1, Player.Name, Colors.TextHeading); statsConsole.Print(1, 2, "_____", Colors.TextHeading); statsConsole.Print(1, 21, "Enemies:", Colors.TextHeading); statsConsole.Print(1, 22, "________", Colors.TextHeading); inventoryConsole.SetBackColor(0, 0, inventoryWidth, inventoryHeight, Palette.PrimaryDarker); inventoryConsole.Print(1, 1, "Inventory", Colors.TextHeading); inventoryConsole.Print(1, 2, "_________", Colors.TextHeading); inventoryConsole.Print(1, 5, "Slot 1: " + Inventory.slot1, Colors.TextHeading); inventoryConsole.Print(1, 7, "Slot 2: " + Inventory.slot2, Colors.TextHeading); inventoryConsole.Print(1, 9, "Slot 3: " + Inventory.slot3, Colors.TextHeading); inventoryConsole.Print(1, 11, "Slot 4: " + Inventory.slot4, Colors.TextHeading); inventoryConsole.Print(1, 13, "Slot 5: " + Inventory.slot5, Colors.TextHeading); armourConsole.SetBackColor(0, 0, armourWidth, armourHeight, Palette.PrimaryDarker); armourConsole.Print(1, 1, "Armour", Colors.TextHeading); armourConsole.Print(1, 2, "______", Colors.TextHeading); Player.DrawArmour(armourConsole); //Draw the map subdivision to the screen DungeonMap.Draw(mapConsole, statsConsole); //Draw the player to the dungeon map Player.Draw(mapConsole, DungeonMap); Player.DrawStats(statsConsole); //Blits the subdivisions to the window //(https://en.wikipedia.org/wiki/Bit_blit) //Map RLConsole.Blit(mapConsole, 0, 0, mapWidth, mapHeight, rootConsole, 0, 0); //Messages RLConsole.Blit(messageConsole, 0, 0, messageWidth, messageHeight, rootConsole, inventoryWidth, (screenHeight - messageHeight)); //Stats RLConsole.Blit(statsConsole, 0, 0, statsWidth, statsHeight, rootConsole, mapWidth, 0); //Inventory RLConsole.Blit(inventoryConsole, 0, 0, inventoryWidth, inventoryHeight, rootConsole, 0, mapHeight); //Armour RLConsole.Blit(armourConsole, 0, 0, armourWidth, armourHeight, rootConsole, screenWidth - armourWidth, screenHeight - armourHeight); //Tells RLNet to draw the console that we specified in rootConsole rootConsole.Draw(); //After everything has rendered, don't render again until an update renderRequired = false; } }
public void Draw(RLConsole console) { console.Clear(); string[] lines = _lines.ToArray(); for (int i = 0; i < lines.Length; i++) { console.Print(1, i + 1, lines[i], RLColor.White); } }
public void Draw(RLConsole mapConsole, RLConsole statConsole) { mapConsole.Clear(); foreach (ICell cell in GetAllCells()) { SetConsoleSymbolForCell(mapConsole, cell); } int i = 0; foreach (Monster monster in Monsters) { if (monster.Size == 1) { if (IsInFov(monster.X, monster.Y)) { monster.Draw(mapConsole, this); monster.DrawStats(statConsole, i); i++; } else { if (GetCell(monster.X, monster.Y).IsExplored) { mapConsole.Set(monster.X, monster.Y, Colors.Floor, Colors.FloorBackground, '.'); } } } else { // If player can see at least one part of the big monster, draw it fully if (monster.AreaControlled.Any(cell => IsInFov(cell.X, cell.Y))) { monster.Draw(mapConsole, this); monster.DrawStats(statConsole, i); i++; } // If big monster is fully out from FoV, draw dots on its place else if (monster.AreaControlled.All(cell => !IsInFov(cell.X, cell.Y) && IsExplored(cell.X, cell.Y))) { foreach (ICell cell in monster.AreaControlled) { mapConsole.Set(cell.X, cell.Y, Colors.Floor, Colors.FloorBackground, '.'); } } } } foreach (IItem item in Items) { item.Draw(mapConsole, this); } foreach (Door door in Doors) { door.Draw(mapConsole, this); } StairsUp.Draw(mapConsole, this); StairsDown.Draw(mapConsole, this); }
private static void Check() { if (Levels.Count != 0) { messageConsole.Clear(); inventoryConsole.Clear(); statConsole.Clear(); CommandSystem.PlayerIsDead = false; CommandSystem.IsGameEnded = false; Player = null; Levels.Clear(); SchedulingSystems.Clear(); CurrentLevel = null; CurrentSchedulingSystem = null; DungeonMap = null; SchedulingSystem = new SchedulingSystem(); MessageLog.Clear(); } }
// Draw each line of the MessageLog queue to the console public void Draw(RLConsole console) { console.Clear(); string[] lines = _lines.ToArray(); for (int i = 0; i < lines.Count(); i++) { console.Print(1, i + 1, lines[i], Colors.Text); } }
public void CreateMenu(RLConsole rootConsole, List <string> LineArr) { menuConsole = new RLConsole(_width, _height); menuConsole.Clear(); Draw(LineArr); RLConsole.Blit(menuConsole, 0, 0, _width, _height, rootConsole, 0, 0); }
// The Draw method will be called each time the map is updated // It will render all of the symbols/colors for each cell to the map sub console public void Draw(RLConsole mapConsole, RLConsole statConsole, RLConsole inventoryConsole) { //clear the map mapConsole.Clear(); // Drawing the cells. foreach (DungeonCell cell in GetAllCells()) { SetConsoleSymbolForCell(mapConsole, cell); } // Drawing the doors. foreach (Door door in Doors) { door.Draw(mapConsole, this); } // Drawing Stairs. StairsUp.Draw(mapConsole, this); StairsDown.Draw(mapConsole, this); // Drawing treasure foreach (TreasurePile treasurePile in _treasurePiles) { IDrawable drawableTreasure = treasurePile.Treasure as IDrawable; drawableTreasure?.Draw(mapConsole, this); } // clear the stats statConsole.Clear(); // Keep an index so we know which position to draw monster stats at int i = 0; // Iterate through each monster on the map and draw it after drawing the Cells foreach (Monster monster in _monsters) { monster.Draw(mapConsole, this); // When the monster is in the field-of-view also draw their stats if (IsInFov(monster.X, monster.Y)) { // Pass in the index to DrawStats and increment it afterwards monster.DrawStats(statConsole, i); i++; } } Player player = Game.Player; //update the player and player info. player.Draw(mapConsole, this); player.DrawStats(statConsole); player.DrawInventory(inventoryConsole); }
// Draw each line of the MessageLog queue to the console public void Draw(RLConsole console, int _messageWidth, int _messageHeight) { console.Clear(); console.SetBackColor(0, 0, _messageWidth, _messageHeight, Swatch.DbDeepWater); string[] lines = _lines.ToArray(); console.Print(1, 0, "Messages", Colors.TextHeading); for (int i = 0; i < lines.Length; i++) { console.Print(1, i + 1, lines[i], RLColor.White); } }
private static void OnRootConsoleUpdate(object sender, UpdateEventArgs e) { _commandConsole.Clear(); _mapConsole.Clear(); _unitConsole.Clear(); _inputHandler.Update(_unitConsole); _commandConsole.SetBackColor(0, 0, _commandWidth, _commandHeight, RLColor.Cyan); _commandConsole.Print(1, 1, "Commands!", RLColor.White); world.Update(); }
public void OnRender() { _inventoryConsole.Clear(); _messageConsole.Clear(); DrawInventory(_inventoryConsole); GameController.InventorySystem.Draw(_inventoryConsole); GameController.MessageLog.Draw(_messageConsole); RLConsole.Blit(_inventoryConsole, 0, 0, INVENTORYWIDTH, INVENTORYHEIGHT, _rootConsole, 0, 11); RLConsole.Blit(_messageConsole, 0, 0, MESSAGEWIDTH, MESSAGEHEIGHT, _rootConsole, 0, Game.SCREENHEIGHT - MESSAGEHEIGHT); }
public void Draw(RLConsole map_console) { map_console.Clear(); foreach (Cell cell in GetAllCells()) { SetConsoleSymbolForCell(map_console, cell); } foreach (Monster monster in _monsters) { monster.Draw(map_console, this); } }
private static void OnRootConsoleRender(object sender, UpdateEventArgs e) { if (_renderRequired) { _mapConsole.Clear(); _statConsole.Clear(); _messageConsole.Clear(); _inventoryConsole.Clear(); DungeonMap.Draw(_mapConsole, _statConsole); Player.Draw(_mapConsole, DungeonMap); Player.DrawStats(_statConsole); Player.DrawInventory(_inventoryConsole); MessageLog.Draw(_messageConsole); _messageConsole.SetBackColor(0, 0, _messageWidth, _messageHeight, Swatch.DbDark); TargetingSystem.Draw(_mapConsole); RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight); RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0); RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight); RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0); if (IsInventoryScreenShowing) { InventoryScreen.Draw(_rootConsole, Player.Inventory); } if (IsDialogScreenShowing) { DialogScreen.Draw(_rootConsole); } if (IsShopSelectionScreenShowing) { ShopSelectionScreen.Draw(_rootConsole); } if (IsBuyScreenShowing) { BuyScreen.Draw(_rootConsole); } if (IsSellScreenShowing) { SellScreen.Draw(_rootConsole, Player.Inventory); } _rootConsole.Draw(); _renderRequired = false; } }
public void Draw(RLConsole mapConsole) { mapConsole.Clear(); foreach (Cell cell in GetAllCells()) { SetConsoleSymbolForCell(mapConsole, cell); } foreach (Monster monster in _monsters) { monster.Draw(mapConsole, this); } foreach (KeyValuePair <Point, Pickup> pickup in _pickups) { pickup.Value.Draw(mapConsole, this, pickup.Key); } StairsDown.Draw(mapConsole, this); }
//Displays a map with a message log below private static void DisplayMap(SpaceSystem map) { _starMapConsole.Clear(); //creates a box outline for the map DisplayBorder(_starMapConsole); _starMapConsole.SetBackColor(0, 0, _starMapConsoleWidth, _starMapConsoleHeight, RLColor.Black); _logConsole.SetBackColor(0, 0, _logConsoleWidth, _logConsoleHeight, RLColor.Gray); map.Draw(_starMapConsole, _starMapConsoleWidth, _starMapConsoleHeight); _starMapConsole.Print(5, 5, "System Map", RLColor.White); _starMapConsole.Print(5, 7, map.Name, map.Star.Color); _starMapConsole.Print(5, 9, map.Star.Type, RLColor.White); _starMapConsole.Print(2, 2, $"{currentSystem + 1}", RLColor.White); _logConsole.Print(5, 2, "Log", RLColor.White); RLConsole.Blit(_starMapConsole, 0, 0, _starMapConsoleWidth, _starMapConsoleHeight, _rootConsole, 0, 0); RLConsole.Blit(_logConsole, 0, 0, _logConsoleWidth, _logConsoleHeight, _rootConsole, 0, _starMapConsoleHeight); }
private static void OnRootConsoleRender(object sender, UpdateEventArgs e) { /*Blit the sub consoles that I just created too the correct locations on the app * The parameters of a blit are * 1. the source console * 2. the x position 3. the y position * 4. The width 5. the height * 6. a destination console to blit to * 7. the blit destination of the top left corner of where we will blit to in the destination console */ //if a render is required draw everything otherwise don't if (_renderRequired) { _mapConsole.Clear(); _statConsole.Clear(); _messageConsole.Clear(); DungeonMap.Draw(_mapConsole, _statConsole); //draw the player into the map player.Draw(_mapConsole, DungeonMap); player.DrawStats(_statConsole); messageLog.Draw(_messageConsole); RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight); RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0); RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight); RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0); _rootConsole.Draw(); _renderRequired = false; } }
public void Draw(RLConsole mapConsole, RLConsole statConsole, RLConsole inventoryConsole) { mapConsole.Clear(); foreach (Cell cell in GetAllCells()) { SetConsoleSymbolForCell(mapConsole, cell); } foreach (Door door in Doors) { door.Draw(mapConsole, this); } StairsUp.Draw(mapConsole, this); StairsDown.Draw(mapConsole, this); foreach (TreasurePile treasurePile in _treasurePiles) { IDrawable drawableTreasure = treasurePile.Treasure as IDrawable; drawableTreasure?.Draw(mapConsole, this); } statConsole.Clear(); int i = 0; foreach (Monster monster in _monsters) { monster.Draw(mapConsole, this); if (IsInFov(monster.X, monster.Y)) { monster.DrawStats(statConsole, i); i++; } } Player player = Game.Player; player.Draw(mapConsole, this); player.DrawStats(statConsole); player.DrawInventory(inventoryConsole); }
protected override void DisplayInternal(RLConsole console, IDataRogueControl control, ISystemContainer systemContainer, List <MapCoordinate> playerFov) { var messageConfiguration = control as MessageLogControl; var MessageConsole = new RLConsole(control.Position.Width, control.Position.Height); MessageConsole.Clear(); var messages = systemContainer.MessageSystem.RecentMessages(messageConfiguration.NumberOfMessages); messages.Reverse(); int y = messageConfiguration.Position.Height - 1; foreach (Message message in messages) { MessageConsole.Print(0, y--, 1, message.Text, message.Color.ToRLColor(), null, MessageConsole.Width); } RLConsole.Blit(MessageConsole, 0, 0, MessageConsole.Width, MessageConsole.Height, console, messageConfiguration.Position.Left, messageConfiguration.Position.Top); }