Exemple #1
0
        protected override void OnPopulateMesh(VertexHelper vertexHelper)
        {
            UF_OnPopulateTextMesh(vertexHelper);
            //RichText 的处理在这里

            //基于 tokens  处理富文本
            if (this.supportRichText && (textTokens.Count > 0 || outline))
            {
                List <UIVertex> tempUIVerts = ListCache <UIVertex> .Acquire();

                vertexHelper.GetUIVertexStream(tempUIVerts);
                //根据m_HandleTokenBit 值处理对应的RichText
                RichText.UF_OnPopulateMesh(this, textTokens, tempUIVerts);

                int sourceLen  = tempUIVerts.Count;
                int startIndex = 0;
                //全局描边
                if (outline)
                {
                    RTOutline.UF_HandleMesh(tempUIVerts, GHelper.UF_IntToColor(outlineColor), outlineParam, startIndex);
                    startIndex = tempUIVerts.Count - sourceLen;
                }
                //全局阴影
                if (shadow)
                {
                    RTShadow.UF_HandleMesh(tempUIVerts, GHelper.UF_IntToColor(shadowColor), shadowParam, startIndex);
                    startIndex = tempUIVerts.Count - sourceLen;
                }


                vertexHelper.Clear();
                vertexHelper.AddUIVertexTriangleStream(tempUIVerts);

                ListCache <UIVertex> .Release(tempUIVerts);
            }
        }
Exemple #2
0
 public static Color UF_GetColor(int v)
 {
     return(GHelper.UF_IntToColor(v));
 }