private void createComposedContents() { if (mImage != null) { mImage.removeFromParent(true); mImage = null; } if (mQuadBatch == null) { mQuadBatch = new AsQuadBatch(); mQuadBatch.setTouchable(false); addChild(mQuadBatch); } else { mQuadBatch.reset(); } AsBitmapFont bitmapFont = (AsBitmapFont)(getBitmapFonts()[mFontName]); if (bitmapFont == null) { throw new AsError("Bitmap font not registered: " + mFontName); } bitmapFont.fillQuadBatch(mQuadBatch, mHitArea.getWidth(), mHitArea.getHeight(), mText, mFontSize, mColor, mHAlign, mVAlign, mAutoScale, mKerning); mTextBounds = null; }
public virtual void finishQuadBatch() { AsQuadBatch currentBatch = mQuadBatches[mCurrentQuadBatchID]; if (currentBatch.getNumQuads() != 0) { currentBatch.renderCustom(mProjectionMatrix); currentBatch.reset(); ++mCurrentQuadBatchID; ++mDrawCount; if (mQuadBatches.getLength() <= mCurrentQuadBatchID) { mQuadBatches.push(new AsQuadBatch()); } } }