Exemplo n.º 1
0
 public static void OrphanizeChildren(this DisplayObjectContainer e)
 {
     while (e.numChildren > 0)
     {
         e.getChildAt(0).Orphanize();
     }
 }
Exemplo n.º 2
0
        public static IEnumerable <DisplayObject> EnumKinds(DisplayObjectContainer container)
        {
            int n = container.numChildren;

            for (int i = 0; i < n; i++)
            {
                yield return(container.getChildAt(i));
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="pcolor"></param>
        /// <param name="movieClip"></param>
        private void renderDisplayObjectContainer(DisplayObjectContainer parent, Color pcolor, bool movieClip)
        {
            if (phaseId == 0)
            {
                if (parent.updateCounter != updateCounter)
                {
                    sameUpdateCounter = false;
                }
            }
            else if (phaseId == 1)
            {
                parent.updateCounter = Time.frameCount;
            }

            for (int i = 0; i < parent.numChildren; i++)
            {
                if (movieClip)
                {
                    MovieClip obj2 = parent.getChildAt(i) as MovieClip;

                    if (obj2.visible)
                    {
                        BitmapAssetInfo info = obj2.bmpInfo;
                        renderGraphics(info, obj2, obj2.colorTransform);
                        renderDisplayObjectContainer(obj2, obj2.colorTransform, false);
                    }
                }
                else
                {
                    DisplayObjectContainer obj2 = parent.getChildAt(i) as DisplayObjectContainer;

                    BitmapAssetInfo info = obj2.bmpInfo;
                    renderGraphics(info, obj2, pcolor);
                    renderDisplayObjectContainer(obj2, pcolor, false);
                }
            }
        }
Exemplo n.º 4
0
        static void MoveChildren(DisplayObjectContainer container, double dx, double dy)
        {
            if (dx == 0 && dy == 0)
            {
                return;
            }
            bool h = dx != 0;
            bool v = dy != 0;
            int  n = container.numChildren;

            for (int i = 0; i < n; ++i)
            {
                var child = container.getChildAt(i);
                if (h)
                {
                    child.x += dx;
                }
                if (v)
                {
                    child.y += dy;
                }
            }
        }