示例#1
0
        override public void SetFormat(TextFormat format, float fontSizeScale)
        {
            _format = format;

            float size = format.size * fontSizeScale;

            if (_format.specialStyle == TextFormat.SpecialStyle.Subscript || _format.specialStyle == TextFormat.SpecialStyle.Superscript)
            {
                size *= SupScale;
            }

            _scale = size / _fontAsset.faceInfo.pointSize * _fontAsset.faceInfo.scale;
            _style = FontStyles.Normal;
            if (format.bold)
            {
                _style         |= FontStyles.Bold;
                _fontWeight     = FontWeight.Bold;
                _boldMultiplier = 1 + _fontAsset.boldSpacing * 0.01f;
            }
            else
            {
                _fontWeight     = _defaultFontWeight;
                _boldMultiplier = 1.0f;
            }
            if (format.italic)
            {
                _style |= FontStyles.Italic;
            }

            format.FillVertexColors(vertexColors);
        }
示例#2
0
        override public void SetFormat(TextFormat format, float fontSizeScale)
        {
            _format = format;
            float size = format.size * fontSizeScale;

            if (keepCrisp)
            {
                size *= UIContentScaler.scaleFactor;
            }
            if (_format.specialStyle == TextFormat.SpecialStyle.Subscript || _format.specialStyle == TextFormat.SpecialStyle.Superscript)
            {
                size *= SupScale;
            }
            _size = Mathf.FloorToInt(size);
            if (_size == 0)
            {
                _size = 1;
            }
            _scale = (float)_size / _font.fontSize;

            if (format.bold && !customBold)
            {
                if (format.italic)
                {
                    if (customBoldAndItalic)
                    {
                        _style = FontStyle.Italic;
                    }
                    else
                    {
                        _style = FontStyle.BoldAndItalic;
                    }
                }
                else
                {
                    _style = FontStyle.Bold;
                }
            }
            else
            {
                if (format.italic)
                {
                    _style = FontStyle.Italic;
                }
                else
                {
                    _style = FontStyle.Normal;
                }
            }

            _boldVertice = format.bold && (customBold || (format.italic && customBoldAndItalic));
            format.FillVertexColors(vertexColors);
        }
示例#3
0
 static int FillVertexColors(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FairyGUI.TextFormat   obj  = (FairyGUI.TextFormat)ToLua.CheckObject <FairyGUI.TextFormat>(L, 1);
         UnityEngine.Color32[] arg0 = ToLua.CheckStructArray <UnityEngine.Color32>(L, 2);
         obj.FillVertexColors(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#4
0
        override public void SetFormat(TextFormat format, float fontSizeScale)
        {
            if (resizable)
            {
                _scale = (float)format.size / size * fontSizeScale;
            }
            else
            {
                _scale = fontSizeScale;
            }

            if (canTint)
            {
                format.FillVertexColors(vertexColors);
            }
        }