public GameScreen() { _game = new Game(); _view = new View(); // ms / f text var msFText = new Text { Font = new Font("fonts/Quicksand-Bold.ttf"), DisplayedString = " ms / frame: ", Color = Color.White, CharacterSize = 19 }; msFText.SetOriginAtCenter(); msFText.Position = new Vector2f(75, WindowConfig.WindowHeight - 25); _msFLabel = new Label(msFText); Widgets.Add(_msFLabel); }
public MainMenuScreen() { _backgroundSprite = new Sprite(new Texture("sprites/mainmenu.png")); // enter game button var enterGameText = new Text { Font = new Font("fonts/Quicksand-Bold.ttf"), DisplayedString = "enter game", Color = new Color(73, 73, 73) }; enterGameText.SetOriginAtCenter(); enterGameText.Position = new Vector2f(120, WindowConfig.WindowHeight - 200); var enterGameButton = new Button(enterGameText) { HoverSoundFilename = "sounds/buttonhover.wav", DefaultTextColor = new Color(73, 73, 73), TextHighlightColor = new Color(242, 242, 242), ClickAction = () => { State.CurrentScreen = new GameScreen(); } }; Widgets.Add(enterGameButton); // options button var optionsText = new Text { Font = new Font("fonts/Quicksand-Bold.ttf"), DisplayedString = "options", Color = new Color(73, 73, 73) }; optionsText.SetOriginAtCenter(); optionsText.Position = new Vector2f(140, WindowConfig.WindowHeight - 140); var optionsButton = new Button(optionsText) { HoverSoundFilename = "sounds/buttonhover.wav", DefaultTextColor = new Color(73, 73, 73), TextHighlightColor = new Color(242, 242, 242) }; Widgets.Add(optionsButton); // exit game button var exitGameText = new Text { Font = new Font("fonts/Quicksand-Bold.ttf"), DisplayedString = "exit game", Color = new Color(73, 73, 73) }; exitGameText.SetOriginAtCenter(); exitGameText.Position = new Vector2f(210, WindowConfig.WindowHeight - 80); var exitGameButton = new Button(exitGameText) { HoverSoundFilename = "sounds/buttonhover.wav", DefaultTextColor = new Color(73, 73, 73), TextHighlightColor = new Color(242, 242, 242), ClickAction = () => { State.Open = false; } }; Widgets.Add(exitGameButton); }