FairyGUI.Utils.HtmlElement.GetInt C# (CSharp) Method

GetInt() public method

public GetInt ( string attrName ) : int
attrName string
return int
        public int GetInt(string attrName)
        {
            return GetInt(attrName, 0);
        }

Same methods

HtmlElement::GetInt ( string attrName, int defValue ) : int

Usage Example

示例#1
0
        public void Create(RichTextField owner, HtmlElement element)
        {
            _owner   = owner;
            _element = element;

            if (comboBox == null)
            {
                return;
            }

            int width  = element.GetInt("width", 0);
            int height = element.GetInt("height", 0);

            if (width == 0)
            {
                width = comboBox.sourceWidth;
            }
            if (height == 0)
            {
                height = comboBox.sourceHeight;
            }

            comboBox.SetSize(width, height);
            comboBox.items  = (string[])element.Get("items");
            comboBox.values = (string[])element.Get("values");
            comboBox.value  = element.GetString("value");
        }
All Usage Examples Of FairyGUI.Utils.HtmlElement::GetInt