Exemplo n.º 1
0
        public override void WriteLine(string value)
        {
            base.WriteLine(value);

            Paragraph paragraph = UiManager.DefaultParagraph(value, Anchor.AutoInLine, Microsoft.Xna.Framework.Color.Black, null, new Microsoft.Xna.Framework.Vector2(0, 20), null);

            UiManager.GetActiveUserInterface().ConsoleWindow.AddChild(paragraph);
        }
Exemplo n.º 2
0
        public ConsoleWindow(PanelProps panelProps) : base(panelProps)
        {
            ConsoleText           = UiManager.DefaultParagraph(string.Empty, Anchor.TopLeft, Color.Black, null, new Vector2(0, 0.75f), null, new Vector2(5, 5));
            PanelOverflowBehavior = PanelOverflowBehavior.VerticalScroll;

            AddChild(ConsoleText);

            Visible = false;
        }
Exemplo n.º 3
0
        public CheckBox(CheckBoxProps checkBoxProps) : base(checkBoxProps)
        {
            TextParagraph      = UiManager.DefaultParagraph(checkBoxProps.Text, Anchor.Auto);
            TextParagraph.Size = new Vector2(0, 10);
            TextParagraph.SetOffset(new Vector2(25, 0));
            TextParagraph.p_HiddenInternalEntity = true;
            AddChild(TextParagraph, true);

            PromiscuousClicksMode = true;

            CHECKBOX_SIZE = checkBoxProps.CheckBoxSize != Vector2.Zero ? checkBoxProps.CheckBoxSize : new Vector2(16, 16);
            Checked       = checkBoxProps.IsChecked;
        }
Exemplo n.º 4
0
        public TextInput(TextInputProps textInputProps) : base(textInputProps)
        {
            p_UseMultiLine = textInputProps.UseMultiLine;

            p_Padding = new Vector2(20, 20);

            if (textInputProps.UseMultiLine && textInputProps.Size.Y == -1)
            {
                p_size.Y *= 4;
            }

            LimitBySize = !p_UseMultiLine;

            TextParagraph = UiManager.DefaultParagraph(string.Empty, p_UseMultiLine ? Anchor.TopLeft : Anchor.CenterLeft);
            TextParagraph.p_HiddenInternalEntity = true;
            AddChild(TextParagraph, true);

            PlaceHolderParagraph = UiManager.DefaultParagraph(string.Empty, p_UseMultiLine ? Anchor.TopLeft : Anchor.CenterLeft);
            PlaceHolderParagraph.p_HiddenInternalEntity = true;
            AddChild(PlaceHolderParagraph, true);

            if (p_UseMultiLine)
            {
                p_scrollBar = new VerticalScrollBar(new SliderProps {
                    Min = 0, Max = 0, EntityAnchor = Anchor.CenterRight, LocalPosition = new Vector2(-8, 0), Size = new Vector2(10, 0)
                });
                p_scrollBar.Value   = 0;
                p_scrollBar.Visible = false;
                p_scrollBar.p_HiddenInternalEntity = true;
                AddChild(p_scrollBar, false);
            }

            TextParagraph.WarpsWords        = p_UseMultiLine;
            PlaceHolderParagraph.WarpsWords = p_UseMultiLine;

            MultiColorParagraph colorTextParagraph = TextParagraph as MultiColorParagraph;

            if (colorTextParagraph != null)
            {
                colorTextParagraph.EnableColorInstructions = false;
            }
        }