public void Draw(ConsoleScreen screen, int left, int top) { screen.SetColor(PaletteColor.Text); screen.Draw(Label, left, top); int offset = left + Label.Length + 1; screen.SetColor(PaletteColor.Accessory); screen.Draw('<', offset, top); offset += 1; screen.SetColor(PaletteColor.Text); screen.Draw(SelectedOption.Label, offset, top); offset += SelectedOption.Label.Length; screen.SetColor(PaletteColor.Accessory); screen.Draw('>', offset, top); }
/// <summary> /// Draw the menu at the given screen position. /// </summary> /// <param name="screen">The screen to draw on</param> /// <param name="left">Position along X-axis in columns</param> /// <param name="top">Position along Y-axis in rows</param> public void Draw(ConsoleScreen screen, int left, int top) { for (int i = 0; i < Items.Count; i++) { if (Items[i] == SelectedItem) { screen.SetColor(PaletteColor.Highlight); screen.Draw(">", left, top + i); } Items[i].Draw(screen, left + 2, top + i); } }
public void Draw(ConsoleScreen screen, int left, int top) { screen.SetColor(PaletteColor.Text); screen.Draw(Text, left, top); }