FairyGUI.Container.Update C# (CSharp) Method

Update() public method

public Update ( UpdateContext context ) : void
context UpdateContext
return void
        public override void Update(UpdateContext context)
        {
            if (_disabled)
                return;

            base.Update(context);

            if (_mask != null)
                context.EnterClipping(this.id, null, null);
            else if (_clipRect != null)
                context.EnterClipping(this.id, this.TransformRect((Rect)_clipRect, null), clipSoftness);

            float savedAlpha = context.alpha;
            context.alpha *= this.alpha;
            bool savedGrayed = context.grayed;
            context.grayed = context.grayed || this.grayed;

            if (_fBatching)
                context.batchingDepth++;

            if (context.batchingDepth > 0)
            {
                if (_mask != null)
                    _mask.graphics.maskFrameId = UpdateContext.frameId;

                int cnt = _children.Count;
                for (int i = 0; i < cnt; i++)
                {
                    DisplayObject child = _children[i];
                    if (child.visible)
                        child.Update(context);
                }
            }
            else
            {
                if (_mask != null)
                {
                    _mask.graphics.maskFrameId = UpdateContext.frameId;
                    _mask.renderingOrder = context.renderingOrder++;
                }

                int cnt = _children.Count;
                for (int i = 0; i < cnt; i++)
                {
                    DisplayObject child = _children[i];
                    if (child.visible)
                    {
                        if (child != _mask)
                            child.renderingOrder = context.renderingOrder++;

                        child.Update(context);
                    }
                }

                if (_mask != null)
                    _mask.graphics.SetStencilEraserOrder(context.renderingOrder++);
            }

            if (_fBatching)
            {
                if (context.batchingDepth == 1)
                    SetRenderingOrder(context);
                context.batchingDepth--;
            }

            context.alpha = savedAlpha;
            context.grayed = savedGrayed;

            if (_clipRect != null || _mask != null)
                context.LeaveClipping();

            if (_paintingMode > 0 && paintingGraphics.texture != null)
                UpdateContext.OnEnd += _captureDelegate;

            if (onUpdate != null)
                onUpdate();
        }

Usage Example

Example #1
0
 static public int Update(IntPtr l)
 {
     try {
         FairyGUI.Container     self = (FairyGUI.Container)checkSelf(l);
         FairyGUI.UpdateContext a1;
         checkType(l, 2, out a1);
         self.Update(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of FairyGUI.Container::Update