コード例 #1
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,
            };
        }