Exemplo n.º 1
0
        public WinAllScreen()
        {
            Title.Text = "Congratulation!";

            WinAllText    = new Label(FontLoader.Load("HeaderFont"), "You have passed all levels!", GlobalData.Theme["Silver"]);
            HighScoreText = new Label(FontLoader.Load("HeaderFont"), "High Score: " + GlobalData.Session.CurrentScore.ToString("N0"), GlobalData.Theme["Yellow"]);

            TextBox    = WindowFactory.CreateTextbox();
            SaveButton = WindowFactory.CreateButton("Back to menu");

            TextBox.Position = new Vector2()
            {
                X = GetControlXPosition(TextBox, 1, 1),
                Y = this.Position.Y + 210f,
            };

            SaveButton.Position = new Vector2()
            {
                X = GetControlXPosition(SaveButton, 1, 1),
                Y = this.Position.Y + 300f,
            };
        }
Exemplo n.º 2
0
        public MessageBox(string title, string text)
        {
            background = TextureLoader.Load("MessageBox");

            Title.Text = title;

            text   = FontHelper.BreakTextIntoLines(text, 50, 3);
            prompt = new Label(defaultFont, text);

            YesButton = WindowFactory.CreateButton("Yes");
            NoButton  = WindowFactory.CreateButton("No");

            YesButton.Position = new Vector2()
            {
                X = GetControlXPosition(YesButton, 1, 2),
                Y = Position.Y + Height * 0.75f,
            };

            NoButton.Position = new Vector2()
            {
                X = GetControlXPosition(NoButton, 2, 2),
                Y = Position.Y + Height * 0.75f,
            };
        }