Ejemplo n.º 1
0
        public Inspecter(EditorState editor) : base(editor)
        {
            _inspecterPanel = new UIPanel()
            {
                Pivot       = new Vector2(0, 0),
                AnchorPoint = new Vector2(0, 0),
                Position    = new Vector2(5, 5),
                SizeFactor  = new Vector2(1, 1),
                Size        = new Vector2(-10, -9),
            };
            _inspectorList = new UIList()
            {
                AnchorPoint = new Vector2(0, 0),
                Pivot       = new Vector2(0, 0),
                SizeFactor  = new Vector2(1f, 1f),
                Size        = new Vector2(-10f, -10f),
                Position    = new Vector2(5f, 5f),
            };
            var scrollBar1 = new UIScrollBarV()
            {
                Name        = "ScrollBar",
                AnchorPoint = new Vector2(1, 0.5f),
                Pivot       = new Vector2(1, 0.5f),
            };

            _inspectorList.SetScrollBarV(scrollBar1);
            _inspecterPanel.AppendChild(_inspectorList);
            AppendChild(_inspecterPanel);
        }
Ejemplo n.º 2
0
        public UIRecipeGraph(RecipeGraphState main) : base(main)
        {
            _canvasPanel = new UIPanel()
            {
                Pivot           = new Vector2(0.5f, 0),
                AnchorPoint     = new Vector2(0.5f, 0),
                Position        = new Vector2(0, 5f),
                SizeFactor      = new Vector2(1, 0.6f),
                Size            = new Vector2(-10, -10),
                PropagationRule = UIEditor.UILib.Enums.PropagationFlags.FocusEvents,
            };
            Canvas = new UICanvas(MainState)
            {
                AnchorPoint = new Vector2(0.5f, 0.5f),
                SizeFactor  = new Vector2(1, 1),
                Size        = new Vector2(-4, -4),
            };

            AppendChild(_canvasPanel);
            _canvasPanel.AppendChild(Canvas);

            var panel = new UIPanel()
            {
                Pivot       = new Vector2(0.5f, 1),
                AnchorPoint = new Vector2(0.5f, 1f),
                Position    = new Vector2(0, -5),
                SizeFactor  = new Vector2(1, 0.4f),
                Size        = new Vector2(-10, -10),
            };

            AppendChild(panel);
            _craftList = new UIList()
            {
                AnchorPoint = new Vector2(0.5f, 0.5f),
                SizeFactor  = new Vector2(1f, 1f),
                Size        = new Vector2(-10, -10),
            };
            var scrollV = new UIScrollBarV()
            {
                AnchorPoint = new Vector2(1, 0.5f),
                Pivot       = new Vector2(1, 0.5f),
            };

            _craftList.SetScrollBarV(scrollV);
            panel.AppendChild(_craftList);
        }
Ejemplo n.º 3
0
        public Browser(EditorState editor) : base(editor)
        {
            PropagationRule = PropagationFlags.FocusEvents;
            _listPanel      = new UIPanel()
            {
                AnchorPoint  = new Vector2(0, 0),
                Pivot        = new Vector2(0, 0),
                SizeFactor   = new Vector2(1f, 1f),
                Size         = new Vector2(-15f, -10f),
                Position     = new Vector2(15f, 5f),
                PanelTexture = UIEditor.Instance.SkinManager.GetTexture("Box_Default"),
            };
            _treeList = new UIBrowserTreeList(Editor)
            {
                AnchorPoint = new Vector2(0, 0),
                Pivot       = new Vector2(0, 0),
                SizeFactor  = new Vector2(1f, 1f),
                Size        = new Vector2(-10f, -10f),
                Position    = new Vector2(5f, 5f),
            };
            var scrollBar1 = new UIScrollBarV()
            {
                Name        = "ScrollBar",
                AnchorPoint = new Vector2(1, 0.5f),
                Pivot       = new Vector2(1, 0.5f),
            };
            var scrollBar2 = new UIScrollBarH()
            {
                Name = "ScrollBarH",
            };
            var toolbar2 = new UIToolBarV()
            {
                SizeFactor      = new Vector2(1f, 1f),
                AnchorPoint     = new Vector2(0f, 0.5f),
                Pivot           = new Vector2(0f, 0.5f),
                PropagationRule = PropagationFlags.BLOCK_ALL,
                ButtonTooltip   = "工具栏",
            };

            AppendChild(_listPanel);
            AppendChild(toolbar2);
            _listPanel.AppendChild(_treeList);
            _treeList.SetScrollBarV(scrollBar1);
            _treeList.SetScrollBarH(scrollBar2);
            _treeList.OnSelect += _treeList_OnSelect;

            _toolBarList = new UISelectableList()
            {
                Pivot      = new Vector2(0, 0),
                Position   = new Vector2(10, 10),
                SizeFactor = new Vector2(1, 1),
                Size       = new Vector2(-20, -20),
            };

            SetupButtons();
            var scrollBar3 = new UIScrollBarV()
            {
                Name        = "工具栏滚动条",
                AnchorPoint = new Vector2(1, 0.5f),
                Pivot       = new Vector2(1, 0.5f),
            };

            _toolBarList.SetScrollBarV(scrollBar3);
            toolbar2.AddToPanel(_toolBarList);
        }