DrawRect() public method

Draw a rectangle. 画矩形。
public DrawRect ( float aWidth, float aHeight, int lineSize, Color lineColor, Color fillColor ) : void
aWidth float Width
aHeight float Height
lineSize int Line size
lineColor Color Line color
fillColor Color Fill color
return void
示例#1
0
 void CreateModalLayer()
 {
     _modalLayer = new GGraph();
     _modalLayer.DrawRect(this.width, this.height, 0, Color.White, UIConfig.modalLayerColor);
     _modalLayer.AddRelation(this, RelationType.Size);
     _modalLayer.name = "ModalLayer";
 }
示例#2
0
        public GGraph CreateModalLayer()
        {
            var modal = new GGraph();

            modal.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
            modal.AddRelation(this, RelationType.Size);
            modal.name = modal.gameObjectName = "ModalLayer";
            modal.SetHome(this);
            return(modal);
        }
示例#3
0
        private void AdjustModalLayer()
        {
            if (_modalLayer == null)
            {
                _modalLayer = new GGraph();
                _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
                _modalLayer.AddRelation(this, RelationType.Size);
            }

            int  cnt             = this.numChildren;
            bool modalLayerIsTop = false;

            if (_modalWaitPane != null && _modalWaitPane.parent != null)
            {
                SetChildIndex(_modalWaitPane, cnt - 1);
            }

            for (int i = cnt - 1; i >= 0; i--)
            {
                GObject g = this.GetChildAt(i);
                if (g == _modalLayer)
                {
                    modalLayerIsTop = true;
                }
                else if ((g is Window) && (g as Window).modal)
                {
                    if (_modalLayer.parent == null)
                    {
                        AddChildAt(_modalLayer, i);
                    }
                    else if (i > 0)
                    {
                        if (modalLayerIsTop)
                        {
                            SetChildIndex(_modalLayer, i);
                        }
                        else
                        {
                            SetChildIndex(_modalLayer, i - 1);
                        }
                    }
                    else
                    {
                        AddChildAt(_modalLayer, 0);
                    }
                    return;
                }
            }

            if (_modalLayer.parent != null)
            {
                RemoveChild(_modalLayer);
            }
        }
示例#4
0
        void __addedToStage()
        {
            nativeStage.onStageResized.Add(__winResize);
            nativeStage.onMouseDown.AddCapture(__stageMouseDown);

            __winResize();

            _modalLayer = new GGraph();
            _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
            _modalLayer.shape.name = "test";
            _modalLayer.AddRelation(this, RelationType.Size);
        }
    private void PlayDepth()
    {
        GComponent obj = _demoObjects["Depth"];
        GComponent testContainer = obj.GetChild("n22").asCom;
        GObject fixedObj = testContainer.GetChild("n0");
        fixedObj.sortingOrder = 100;
        fixedObj.draggable = true;

        int numChildren = testContainer.numChildren;
        int i = 0;
        while (i < numChildren)
        {
            GObject child = testContainer.GetChildAt(i);
            if (child != fixedObj)
            {
                testContainer.RemoveChildAt(i);
                numChildren--;
            }
            else
                i++;
        }
        startPos = new Vector2(fixedObj.x, fixedObj.y);

        obj.GetChild("btn0").onClick.Add(() =>
        {
            GGraph graph = new GGraph();
            startPos.x += 10;
            startPos.y += 10;
            graph.xy = startPos;
            graph.DrawRect(150, 150, 1, Color.black, Color.red);
            obj.GetChild("n22").asCom.AddChild(graph);
        });

        obj.GetChild("btn1").onClick.Add(() =>
        {
            GGraph graph = new GGraph();
            startPos.x += 10;
            startPos.y += 10;
            graph.xy = startPos;
            graph.DrawRect(150, 150, 1, Color.black, Color.green);
            graph.sortingOrder = 200;
            obj.GetChild("n22").asCom.AddChild(graph);
        });
    }
示例#6
0
 static int DrawRect(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 6);
         FairyGUI.GGraph   obj  = (FairyGUI.GGraph)ToLua.CheckObject <FairyGUI.GGraph>(L, 1);
         float             arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         float             arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
         int               arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
         UnityEngine.Color arg3 = ToLua.ToColor(L, 5);
         UnityEngine.Color arg4 = ToLua.ToColor(L, 6);
         obj.DrawRect(arg0, arg1, arg2, arg3, arg4);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
        private void AdjustModalLayer()
        {
            if (_modalLayer == null)
            {
                _modalLayer = new GGraph();
                _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
                _modalLayer.AddRelation(this, RelationType.Size);
                _modalLayer.gameObjectName = "ModalLayer";
                _modalLayer.SetHome(this);
            }

            int cnt = this.numChildren;

            if (_modalWaitPane != null && _modalWaitPane.parent != null)
            {
                SetChildIndex(_modalWaitPane, cnt - 1);
            }

            for (int i = cnt - 1; i >= 0; i--)
            {
                GObject g = this.GetChildAt(i);
                if ((g is Window) && (g as Window).modal)
                {
                    if (_modalLayer.parent == null)
                    {
                        AddChildAt(_modalLayer, i);
                    }
                    else
                    {
                        SetChildIndexBefore(_modalLayer, i);
                    }
                    return;
                }
            }

            if (_modalLayer.parent != null)
            {
                RemoveChild(_modalLayer);
            }
        }
 static public int DrawRect(IntPtr l)
 {
     try {
         FairyGUI.GGraph self = (FairyGUI.GGraph)checkSelf(l);
         System.Single   a1;
         checkType(l, 2, out a1);
         System.Single a2;
         checkType(l, 3, out a2);
         System.Int32 a3;
         checkType(l, 4, out a3);
         UnityEngine.Color a4;
         checkType(l, 5, out a4);
         UnityEngine.Color a5;
         checkType(l, 6, out a5);
         self.DrawRect(a1, a2, a3, a4, a5);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#9
0
        private void AdjustModalLayer()
        {
            if (_modalLayer == null)
            {
                _modalLayer = new GGraph();
                _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
                _modalLayer.AddRelation(this, RelationType.Size);
                _modalLayer.gameObjectName = "ModalLayer";
                _modalLayer.SetHome(this);
            }

            int cnt = this.numChildren;

            if (_modalWaitPane != null && _modalWaitPane.parent != null)
                SetChildIndex(_modalWaitPane, cnt - 1);

            for (int i = cnt - 1; i >= 0; i--)
            {
                GObject g = this.GetChildAt(i);
                if ((g is Window) && (g as Window).modal)
                {
                    if (_modalLayer.parent == null)
                        AddChildAt(_modalLayer, i);
                    else
                        SetChildIndexBefore(_modalLayer, i);
                    return;
                }
            }

            if (_modalLayer.parent != null)
                RemoveChild(_modalLayer);
        }
示例#10
0
文件: GRoot.cs 项目: yinlei/Fishing
        private void AdjustModalLayer()
        {
            if (_modalLayer == null)
            {
                _modalLayer = new GGraph();
                _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
                _modalLayer.AddRelation(this, RelationType.Size);
            }

            int cnt = this.numChildren;
            bool modalLayerIsTop = false;

            if (_modalWaitPane != null && _modalWaitPane.parent != null)
                SetChildIndex(_modalWaitPane, cnt - 1);

            for (int i = cnt - 1; i >= 0; i--)
            {
                GObject g = this.GetChildAt(i);
                if (g == _modalLayer)
                    modalLayerIsTop = true;
                else if ((g is Window) && (g as Window).modal)
                {
                    if (_modalLayer.parent == null)
                        AddChildAt(_modalLayer, i);
                    else if (i > 0)
                    {
                        if (modalLayerIsTop)
                            SetChildIndex(_modalLayer, i);
                        else
                            SetChildIndex(_modalLayer, i - 1);
                    }
                    else
                        AddChildAt(_modalLayer, 0);
                    return;
                }
            }

            if (_modalLayer.parent != null)
                RemoveChild(_modalLayer);
        }
示例#11
0
        void __addedToStage()
        {
            nativeStage.onStageResized.Add(__winResize);
            nativeStage.onMouseDown.AddCapture(__stageMouseDown);

            __winResize();

            _modalLayer = new GGraph();
            _modalLayer.DrawRect(this.width, this.height, 0, Color.white, UIConfig.modalLayerColor);
            _modalLayer.shape.name = "test";
            _modalLayer.AddRelation(this, RelationType.Size);
        }