Ejemplo n.º 1
0
        private void Load()
        {
            _textFlowContainer = new CustomizableTextContainer
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,

                RelativeSizeAxes = Axes.Both,
                TextAnchor       = Anchor.Centre,
            };

            var warningIcon = _textFlowContainer.AddPlaceholder(_spriteIcon = new SpriteIcon
            {
                Icon   = FontAwesome.Solid.ExclamationTriangle,
                Size   = new Vector2(48),
                Colour = Color4.Yellow,
            });

            _textFlowContainer.AddParagraph($"[{warningIcon}]");
            _textFlowContainer.AddParagraph("Warning!", text =>
            {
                text.Colour = Color4.Yellow;
                text.Font   = new FontUsage(size: 32, weight: "Bold");
            });
            _textFlowContainer.AddParagraph("This game is currently in really early alpha! Bugs to be expected.");
            _textFlowContainer.AddParagraph("Please consider reporting them all, no matter how small they are.");

            AddInternal(_textFlowContainer);
        }
Ejemplo n.º 2
0
        public void TestLanguageSwitch()
        {
            CustomizableTextContainer container = null;

            AddStep("create container", () => Child = container = new CustomizableTextContainer
            {
                RelativeSizeAxes = Axes.Both
            });

            AddStep("add content to container", () =>
            {
                int first = container.AddPlaceholder(new SpriteIcon
                {
                    Size = new Vector2(16),
                    Icon = FontAwesome.Regular.Comment
                });

                int second = container.AddPlaceholder(new CircularContainer
                {
                    Size    = new Vector2(30, 16),
                    Masking = true,
                    Child   = new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = Colour4.Goldenrod
                    }
                });

                container.AddText(new RomanisableString(
                                      $"this original [{first}] text has [{second}] placeholder",
                                      $"this romanised text [{first}] has placeholder [{second}]"));
            });

            AddStep("prefer unicode", () => configManager.SetValue(FrameworkSetting.ShowUnicode, true));
            AddStep("prefer ASCII", () => configManager.SetValue(FrameworkSetting.ShowUnicode, false));
        }