FairyGUI.Utils.HtmlSelect.Create C# (CSharp) Method

Create() public method

public Create ( RichTextField owner, HtmlElement element ) : void
owner RichTextField
element HtmlElement
return void
        public void Create(RichTextField owner, HtmlElement element)
        {
            _owner = owner;
            _element = element;

            if (comboBox == null)
                return;

            comboBox.onChanged.Add(_changeHandler);

            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");
        }

Usage Example

Example #1
0
 static public int Create(IntPtr l)
 {
     try {
         FairyGUI.Utils.HtmlSelect self = (FairyGUI.Utils.HtmlSelect)checkSelf(l);
         FairyGUI.RichTextField    a1;
         checkType(l, 2, out a1);
         FairyGUI.Utils.HtmlElement a2;
         checkType(l, 3, out a2);
         self.Create(a1, a2);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }