public void DrawLoadMenu() { VirtualConsole.Clear(); VirtualConsole.DrawBox(20, 45, 40, 2); VirtualConsole.Write("Load Menu", 35, 45, 9, 1); DrawLoadButtons(); }
private void DrawFPS() { var fps = AverageCount().ToString(); fps += " FPS"; VirtualConsole.Write(fps, VirtualConsole.instance.width - 7, VirtualConsole.instance.height - 2, 7, 1, 0, 1, 0, 0.5f, 0.5f, 0.5f); }
public void Draw() { VirtualConsole.Clear(); VirtualConsole.DrawBox(20, 45, 40, 2); VirtualConsole.Write("Deckbuilding Roguelike", 30, 45, 40, 1); VirtualConsole.DrawBox(30, 30, 20, 2); VirtualConsole.Write("Start", 38, 30, 6, 1); VirtualConsole.DrawBox(30, 26, 20, 2); VirtualConsole.Write("Load", 38, 26, 5, 1); }
private void DrawLoadButtons() { var saveDirectory = Application.persistentDataPath; var filenames = Directory.GetFiles(saveDirectory, "*.json"); int cursor = 34; foreach (var filename in filenames) { cursor -= 4; VirtualConsole.DrawBox(30, cursor, 20, 2); var shortenedName = Path.GetFileNameWithoutExtension(filename); VirtualConsole.Write(shortenedName, 30 + (10 - shortenedName.Length / 2), cursor, 20, 1); } }
/// <summary> /// Draws the on the Virtual Console /// <seealso cref="T:PurpleRadiant.VirtualConsole"/> /// </summary> public void DrawOnVC() { int i, j; for (i = 0; i < m_height; i++) { for (j = 0; j < m_width; j++) { VirtualConsole.ForegroundColor = cc[i, j, 0]; VirtualConsole.BackgroundColor = cc[i, j, 1]; VirtualConsole.Write(buf[i, j]); } //VirtualConsole.WriteLine (); } }
private void DrawLogMessages() { while (logMessages.Count > 6) { logMessages.RemoveAt(0); } var concat = ""; foreach (var logMessage in logMessages) { concat += logMessage + "\n"; } if (concat != "") { concat = concat.Substring(0, concat.Length - 1); } concat = PruneLinesToFit(concat); VirtualConsole.Write(concat, 48, 16, VirtualConsole.instance.width - 50, 6); }
private void DrawHUD() { var level = "Level " + Player.instance.level.ToString(); var hp = "HP: " + Player.instance.hp.ToString() + "/" + Player.instance.maxHp.ToString(); var actions = "Actions: " + Player.instance.actions.ToString(); var energy = "Energy: " + Player.instance.energy.ToString(); var deck = "Cards in Deck: " + Player.instance.deck.Count.ToString(); var discard = "Cards in Discard: " + Player.instance.discard.Count.ToString(); var floor = "Floor: " + (Map.instance.currentFloorNumber + 1).ToString(); var experience = "Experience: " + Player.instance.experience.ToString() + "/" + Player.instance.experienceToLevel.ToString(); VirtualConsole.Write(floor, 0, VirtualConsole.instance.height - 2, 9, 1, 1, 1, 1, 0.25f, 0.25f, 0.25f); VirtualConsole.Write(level, 0, VirtualConsole.instance.height - 3, 10, 1, 1, 1, 1, 0.25f, 0.25f, 0.25f); VirtualConsole.DrawBar(hp, Player.instance.hp, Player.instance.maxHp, 0, VirtualConsole.instance.height - 4, 23, 1, 1, 1, 1, 0, 0, 0.5f, 0, 0); VirtualConsole.DrawBar(experience, Player.instance.experience, Player.instance.experienceToLevel, 0, VirtualConsole.instance.height - 5, 23, 1, 1, 1, 0, 0, 1, 0, 0, 0.5f); VirtualConsole.DrawBar(actions, Player.instance.actions, 4, 0, VirtualConsole.instance.height - 6, 23, 0, 0, 0, 0, 1, 0, 0, 0.5f, 0); VirtualConsole.Write(energy, 0, VirtualConsole.instance.height - 7, 10, 1, 1, 1, 1, 0.25f, 0.25f, 0.25f); VirtualConsole.Write(deck, 0, VirtualConsole.instance.height - 8, 18, 1, 1, 1, 1, 0.25f, 0.25f, 0.25f); VirtualConsole.Write(discard, 0, VirtualConsole.instance.height - 9, 21, 1, 1, 1, 1, 0.25f, 0.25f, 0.25f); }
private void WriteTooltipDescription(int mapX, int mapY, int x, int y, int width, int height) { var output = ""; var mapBlock = Map.instance.currentFloor.layout[mapX, mapY]; if (mapBlockDescriptions.ContainsKey(mapBlock.character)) { output += mapBlockDescriptions[mapBlock.character] + "\n"; } if (Map.instance.Visible(mapX, mapY)) { var monster = Map.instance.currentFloor.monsters[mapX, mapY]; if (monster != null && monsterDescriptions.ContainsKey(monster.display.character)) { output += monsterDescriptions[monster.display.character] + "\n"; } } if (Map.instance.posX == mapX && Map.instance.posY == mapY) { output += "You"; } VirtualConsole.Write(output, x, y, width, height); }
private void DrawIndividualCards() { int cardSize = (int)Card.size.x; foreach (var card in Player.instance.hand) { var active = card.beingDragged; var position = card.position; VirtualConsole.DrawBox((int)position.x, (int)position.y, cardSize - 1, 13, active); if (!active) { VirtualConsole.Write(card.template.name, (int)position.x + 1, (int)position.y + 11, cardSize - 4, 1); VirtualConsole.Write("Cost: " + card.template.cost.ToString(), (int)position.x + 1, (int)position.y + 10, cardSize - 4, 1); VirtualConsole.Write(card.template.text, (int)position.x + 1, (int)position.y + 2, cardSize - 4, 8); } else { VirtualConsole.Write(card.template.name, (int)position.x + 1, (int)position.y + 11, cardSize - 4, 1, 1, 1, 1, 0, 0.5f, 0); VirtualConsole.Write("Cost: " + card.template.cost.ToString(), (int)position.x + 1, (int)position.y + 10, cardSize - 4, 1, 1, 1, 1, 0, 0.5f, 0); VirtualConsole.Write(card.template.text, (int)position.x + 1, (int)position.y + 2, cardSize - 4, 8, 1, 1, 1, 0, 0.5f, 0); } } }