FairyGUI.UIPackage.CreateObject C# (CSharp) Method

CreateObject() public static method

Create a UI object.
public static CreateObject ( string pkgName, string resName ) : GObject
pkgName string Package name.
resName string Resource name.
return GObject
        public static GObject CreateObject(string pkgName, string resName)
        {
            UIPackage pkg = GetByName(pkgName);
            if (pkg != null)
                return pkg.CreateObject(resName);
            else
                return null;
        }

Same methods

UIPackage::CreateObject ( PackageItem item, System userClass ) : GObject
UIPackage::CreateObject ( string resName ) : GObject
UIPackage::CreateObject ( string resName, System userClass ) : GObject
UIPackage::CreateObject ( string pkgName, string resName, System userClass ) : GObject

Usage Example

Example #1
0
 static public int CreateObject(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             FairyGUI.UIPackage self = (FairyGUI.UIPackage)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             var ret = self.CreateObject(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 3)
         {
             FairyGUI.UIPackage self = (FairyGUI.UIPackage)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             System.Type a2;
             checkType(l, 3, out a2);
             var ret = self.CreateObject(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of FairyGUI.UIPackage::CreateObject