FairyGUI.TextFormat.CopyFrom C# (CSharp) Method

CopyFrom() public method

public CopyFrom ( TextFormat source ) : void
source TextFormat
return void
        public void CopyFrom(TextFormat source)
        {
            this.size = source.size;
            this.font = source.font;
            this.color = source.color;
            this.lineSpacing = source.lineSpacing;
            this.letterSpacing = source.letterSpacing;
            this.bold = source.bold;
            this.underline = source.underline;
            this.italic = source.italic;
            if (source.gradientColor != null)
            {
                this.gradientColor = new Color32[4];
                source.gradientColor.CopyTo(this.gradientColor, 0);
            }
            else
                this.gradientColor = null;
        }

Usage Example

Example #1
0
        public GTextField()
            : base()
        {
            _textFormat               = new TextFormat();
            _textFormat.font          = UIConfig.defaultFont;
            _textFormat.size          = 12;
            _textFormat.color         = Color.black;
            _textFormat.lineSpacing   = 3;
            _textFormat.letterSpacing = 0;

            TextFormat tf = _textField.textFormat;

            tf.CopyFrom(_textFormat);
            _textField.textFormat = tf;

            _text               = string.Empty;
            _autoSize           = AutoSizeType.Both;
            _widthAutoSize      = true;
            _heightAutoSize     = true;
            _textField.autoSize = true;
            _textField.wordWrap = false;

            gearColor = new GearColor(this);

            onFocusIn  = new EventListener(this, "onFocusIn");
            onFocusOut = new EventListener(this, "onFocusOut");
            onChanged  = new EventListener(this, "onChanged");
        }
All Usage Examples Of FairyGUI.TextFormat::CopyFrom