internal void InitializeText(XmlNode _xmlNode, XmlNode _style) { string fontName = _xmlNode.GetStringValue("Font", _style); Font font = XMLUI.FindFont(fontName); int fontSize = _xmlNode.GetIntValue("Size", _style); string upColorHex = _xmlNode.GetStringValue("Color", _style); string downColorHex = _xmlNode.GetStringValue("Down", _style); float spacing = _xmlNode.GetFloatValue("Spacing", _style); TextAnchor alignment = (TextAnchor)Enum.Parse(typeof(TextAnchor), _xmlNode.GetStringValue("Alignment", _style)); bool autoWrap = _xmlNode.GetBoolValue("AutoWrap", _style); bool bestFit = _xmlNode.GetBoolValue("BestFit", _style); int minSize = _xmlNode.GetIntValue("MinSize", _style); int maxSize = _xmlNode.GetIntValue("MaxSize", _style); string text = _xmlNode.GetStringValue("Text", _style); UpColor = ColorUtility.HexToColor(upColorHex); DownColor = ColorUtility.HexToColor(downColorHex); Property <string> property = null; string propertyName = string.Empty; var result = Regex.Matches(text, @"{[^{}\d]*}") .Cast <Match>() .Select(p => p.Value) .ToList(); if (result.Count > 0) { propertyName = result[0].Substring(1, result[0].Length - 2); property = (Property <string>)ReflectionUtility.FindProperty(this, propertyName); } InitializeTextComponent(font, FontStyle.Normal, fontSize, spacing, true, alignment, autoWrap ? HorizontalWrapMode.Wrap : HorizontalWrapMode.Overflow, VerticalWrapMode.Truncate, bestFit, minSize, maxSize, UpColor, text, property); bool isLabel = _xmlNode.GetBoolValue("Label"); if (isLabel) { (Parent as Button).Labels.Add(this); } }