private void RefractoredDrawKeybindings() { Buttons = new List <ButtonString>(); int _x = 2; int _y = 1; this.DrawBorders(Width, Height, "+", "|", "-", DefaultForeground); for (int i = 0; i < Keybindings.Length; i++) { if (!Keybindings[i].IsVisible) // don't iterate through hidden keybindings { continue; } var btn = new ButtonString(new ColoredString(Keybindings[i].Name.ToString()), Keybindings[i].Key, Color.Green, DefaultForeground, _x, _y); Buttons.Add(btn); _y++; } foreach (var btn in Buttons) { btn.Draw(this); } }
private void DrawButtons() { _playBtn = new ButtonString(new ColoredString("Play"), Microsoft.Xna.Framework.Input.Keys.D1, Color.Green, Color.White, 0, 0, true); _playBtn.Draw(this.GetWindowXCenter() - (_playBtn.GetLength() / 2), this.GetWindowYCenter() + 8, this); _helpBtn = new ButtonString(new ColoredString("Help"), Microsoft.Xna.Framework.Input.Keys.D2, Color.Green, DefaultForeground, 0, 0, true); _helpBtn.DrawNumericOnly(true); _helpBtn.Draw(this.GetWindowXCenter() - (_helpBtn.GetLength() / 2), this.GetWindowYCenter() + 9, this); _quitBtn = new ButtonString(new ColoredString("Quit"), Microsoft.Xna.Framework.Input.Keys.D3, Color.Green, DefaultForeground, 0, 0, true); _quitBtn.DrawNumericOnly(true); _quitBtn.Draw(this.GetWindowXCenter() - (_quitBtn.GetLength() / 2), this.GetWindowYCenter() + 10, this); }
private void DrawButtons() { _backBtn = new ButtonString(new ColoredString("Back"), Microsoft.Xna.Framework.Input.Keys.D1, Color.Green, DefaultForeground, 0, 0, true); _backBtn.Draw(this.GetWindowXCenter() - (_backBtn.GetLength() / 2), this.GetWindowYCenter(), this); }
public static void DrawKeybindings(this SadConsole.Console console, ButtonString button) { button.Draw(console); }