예제 #1
0
        public NameInput(Scene scene, string name, string text, Vector2 position, int width, string oldString)
        {
            Scene         = scene;
            OldString     = oldString;
            NewString     = oldString;
            Position      = position;
            Width         = width;
            MenuAreaBasic = new MenuAreaBasic(this, () => Position, 10);
            SpriteReference textbox    = SpriteLoader.Instance.AddSprite("content/ui_box");
            var             formatting = new TextFormatting()
            {
                Bold = false,
            };
            var dialogInstant = new DialogFormattingInstant();

            UI = new LabelledUI(textbox, textbox, textBuilder =>
            {
                textBuilder.AppendText(name, formatting, dialogInstant);
            }, () => new Point(Width, Height));

            Text = new TextBuilder(Width - 16 - 16, Height);
            Text.StartLine(LineAlignment.Left);
            Text.AppendText(text, formatting, dialogInstant);
            Text.EndLine();
            Text.StartLine(LineAlignment.Left);
            //TODO: Text Input
            Text.EndLine();
            Text.EndContainer();
            Text.Finish();
        }
예제 #2
0
        public InfoBox(Scene scene, Action <TextBuilder> name, Action <TextBuilder> text, Vector2 position, int width, int height)
        {
            Scene         = scene;
            Position      = position;
            Width         = width;
            Height        = height;
            MenuAreaBasic = new MenuAreaBasic(this, () => Position, 10);

            SpriteReference textbox    = SpriteLoader.Instance.AddSprite("content/ui_box");
            var             formatting = new TextFormatting()
            {
                Bold = false,
            };
            var dialogInstant = new DialogFormattingInstant();

            UI = new LabelledUI(textbox, textbox, name, () => new Point(Width, Height));

            Text = new TextBuilder(Width, Height);
            text(Text);
            Text.EndContainer();
            Text.Finish();
        }