示例#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 StatMenu(Scene scene)
        {
            Scene    = scene;
            Width    = scene.Viewport.Width / 3;
            Height   = scene.Viewport.Height / 2;
            Position = new Vector2(scene.Viewport.Width / 2, scene.Viewport.Height / 2);

            UI = new LabelledUI(SpriteLoader.Instance.AddSprite("content/ui_box"), SpriteLoader.Instance.AddSprite("content/ui_box"), null, () => new Point(Width, Height));

            foreach (var file in GetRunScores())
            {
                Tabs.Add(new RunTab(this, file, file.ReloadAsync()));
            }

            LeftTab = Tabs.First();

            var formatName = new TextFormatting()
            {
                Bold = true,
            };
        }
示例#3
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();
        }