GetBounds() public method

public GetBounds ( DisplayObject targetSpace ) : Rect
targetSpace DisplayObject
return UnityEngine.Rect
Exemplo n.º 1
0
        private void CollectChildren(Container initiator)
        {
            int count = _children.Count;

            for (int i = 0; i < count; i++)
            {
                DisplayObject child = _children[i];
                if (child is Container)
                {
                    Container container = (Container)child;
                    container._fBatchingInherited = true;
                    initiator._descendants.Add(container);

                    if (container._clipRect == null)
                    {
                        child.tmpBounds.Set(0, 0, 0, 0);
                        container.CollectChildren(initiator);
                    }
                    else
                    {
                        container.tmpBounds = container.GetClipRect(initiator);
                        container.DoFairyBatching();
                    }
                }
                else
                {
                    child.tmpBounds = child.GetBounds(initiator);
                    initiator._descendants.Add(child);
                }
            }
        }
Exemplo n.º 2
0
        private void CollectChildren(Container initiator)
        {
            int count = _children.Count;

            for (int i = 0; i < count; i++)
            {
                DisplayObject child = _children[i];
                if (child is Container)
                {
                    Container container = (Container)child;
                    if (container._fBatchingRoot)
                    {
                        initiator._descendants.Add(container);
                        container._internal_bounds = container.GetBounds(initiator);
                        if (container._fBatchingRequested)
                        {
                            container.DoFairyBatching();
                        }
                    }
                    else
                    {
                        container.CollectChildren(initiator);
                    }
                }
                else if (child != initiator._mask)
                {
                    child._internal_bounds = child.GetBounds(initiator);
                    initiator._descendants.Add(child);
                }
            }
        }
Exemplo n.º 3
0
        private void CollectChildren(Container initiator, bool outlineChanged)
        {
            int count = _children.Count;

            for (int i = 0; i < count; i++)
            {
                DisplayObject child = _children[i];
                if (!child.visible)
                {
                    continue;
                }

                if (child._batchingBounds == null)
                {
                    child._batchingBounds = new float[4];
                }

                if (child is Container)
                {
                    Container container = (Container)child;
                    if ((container._flags & Flags.BatchingRoot) != 0)
                    {
                        initiator._descendants.Add(container);
                        if (outlineChanged || (container._flags & Flags.OutlineChanged) != 0)
                        {
                            Rect rect = container.GetBounds(initiator);
                            container._batchingBounds[0] = rect.xMin;
                            container._batchingBounds[1] = rect.yMin;
                            container._batchingBounds[2] = rect.xMax;
                            container._batchingBounds[3] = rect.yMax;
                        }
                        if ((container._flags & Flags.BatchingRequested) != 0)
                        {
                            container.DoFairyBatching();
                        }
                    }
                    else
                    {
                        container.CollectChildren(initiator, outlineChanged || (container._flags & Flags.OutlineChanged) != 0);
                    }
                }
                else if (child != initiator._mask)
                {
                    if (outlineChanged || (child._flags & Flags.OutlineChanged) != 0)
                    {
                        Rect rect = child.GetBounds(initiator);
                        child._batchingBounds[0] = rect.xMin;
                        child._batchingBounds[1] = rect.yMin;
                        child._batchingBounds[2] = rect.xMax;
                        child._batchingBounds[3] = rect.yMax;
                    }
                    initiator._descendants.Add(child);
                }

                child._flags &= ~Flags.OutlineChanged;
            }
        }
Exemplo n.º 4
0
        private void CollectChildren(Container initiator, bool outlineChanged)
        {
            int count = _children.Count;

            for (int i = 0; i < count; i++)
            {
                DisplayObject child = _children[i];
                if (!child.visible)
                {
                    continue;
                }

                if (child is Container)
                {
                    Container container = (Container)child;
                    if (container._fBatchingRoot)
                    {
                        initiator._descendants.Add(container);
                        if (outlineChanged || container._outlineChanged)
                        {
                            Rect rect = container.GetBounds(initiator);
                            container._internal_bounds[0] = rect.xMin;
                            container._internal_bounds[1] = rect.yMin;
                            container._internal_bounds[2] = rect.xMax;
                            container._internal_bounds[3] = rect.yMax;
                        }
                        if (container._fBatchingRequested)
                        {
                            container.DoFairyBatching();
                        }
                    }
                    else
                    {
                        container.CollectChildren(initiator, outlineChanged || container._outlineChanged);
                    }
                }
                else if (child != initiator._mask)
                {
                    if (outlineChanged || child._outlineChanged)
                    {
                        Rect rect = child.GetBounds(initiator);
                        child._internal_bounds[0] = rect.xMin;
                        child._internal_bounds[1] = rect.yMin;
                        child._internal_bounds[2] = rect.xMax;
                        child._internal_bounds[3] = rect.yMax;
                    }
                    initiator._descendants.Add(child);
                }

                child._outlineChanged = false;
            }
        }
 static public int GetBounds(IntPtr l)
 {
     try {
         FairyGUI.DisplayObject self = (FairyGUI.DisplayObject)checkSelf(l);
         FairyGUI.DisplayObject a1;
         checkType(l, 2, out a1);
         var ret = self.GetBounds(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }