public override void render(AsRenderSupport support, float parentAlpha)
        {
            float  alpha       = parentAlpha * this.getAlpha();
            int    numChildren = (int)(mChildren.getLength());
            String blendMode   = support.getBlendMode();
            int    i           = 0;

            for (; i < numChildren; ++i)
            {
                AsDisplayObject child = mChildren[i];
                if (child.getHasVisibleArea())
                {
                    AsFragmentFilter filter = child.getFilter();
                    support.pushMatrix();
                    support.transformMatrix(child);
                    support.setBlendMode(child.getBlendMode());
                    if (filter != null)
                    {
                        filter.render(child, support, alpha);
                    }
                    else
                    {
                        child.render(support, alpha);
                    }
                    support.setBlendMode(blendMode);
                    support.popMatrix();
                }
            }
        }
예제 #2
0
 public override void render(AsRenderSupport support, float parentAlpha)
 {
     if (mFlattenedContents != null || mFlattenRequested)
     {
         if (mFlattenedContents == null)
         {
             mFlattenedContents = new AsVector <AsQuadBatch>();
         }
         if (mFlattenRequested)
         {
             AsQuadBatch.compile(this, mFlattenedContents);
             mFlattenRequested = false;
         }
         float    alpha      = parentAlpha * this.getAlpha();
         int      numBatches = (int)(mFlattenedContents.getLength());
         AsMatrix mvpMatrix  = support.getMvpMatrix();
         support.finishQuadBatch();
         support.raiseDrawCount((uint)(numBatches));
         int i = 0;
         for (; i < numBatches; ++i)
         {
             AsQuadBatch quadBatch = mFlattenedContents[i];
             String      blendMode = quadBatch.getBlendMode() == AsBlendMode.AUTO ? support.getBlendMode() : quadBatch.getBlendMode();
             quadBatch.renderCustom(mvpMatrix, alpha, blendMode);
         }
     }
     else
     {
         base.render(support, parentAlpha);
     }
 }
예제 #3
0
 public override void render(AsRenderSupport support, float parentAlpha)
 {
     support.finishQuadBatch();
     support.raiseDrawCount();
     renderCustom(support.getMvpMatrix(), getAlpha() * parentAlpha, support.getBlendMode());
 }