LayoutFarm.Demo_DragSelectionBox.UIControllerBox.GetPrimaryRenderElement C# (CSharp) Method

GetPrimaryRenderElement() public method

public GetPrimaryRenderElement ( RootGraphic rootgfx ) : RenderElement
rootgfx RootGraphic
return RenderElement
            public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx)
            {
                if (!this.HasReadyRenderElement)
                {
                    int gridW = this.Width - 10;
                    int gridH = this.Height - 10;
                    if (gridW < 3)
                    {
                        gridW = 3;
                    }
                    if (gridH < 3)
                    {
                        gridH = 3;
                    }

                    gridBox = new LayoutFarm.CustomWidgets.GridBox(gridW, gridH);
                    gridBox.SetLocation(5, 5);
                    gridBox.BuildGrid(3, 3, CellSizeStyle.UniformCell);
                    var renderE = base.GetPrimaryRenderElement(rootgfx);
                    renderE.AddChild(gridBox);
                    //------------------------------------------------------
                    renderE.AddChild(boxLeftTop);
                    renderE.AddChild(boxRightTop);
                    renderE.AddChild(boxLeftBottom);
                    renderE.AddChild(boxRightBottom);
                    //------------------------------------------------------
                }
                return base.GetPrimaryRenderElement(rootgfx);
            }