Beispiel #1
0
        private void updateTexture()
        {
            CCTexture2D tex;

            // Dump the old one
            if (Texture != null)
            {
                Texture.Dispose();
            }

            // let system compute label's width or height when its value is 0
            // refer to cocos2d-x issue #1430
            tex = new CCTexture2D();

            tex.InitWithString(m_pString,
                               CCMacros.CCSizePointsToPixels(m_tDimensions),
                               m_hAlignment,
                               m_vAlignment,
                               m_pFontName,
                               m_fFontSize * CCMacros.CCContentScaleFactor());

            Texture = tex;

            CCRect rect = CCRect.Zero;
            rect.Size = m_pobTexture.ContentSize;
            SetTextureRect(rect);
        }