public InputTextField() { gameObject.name = "InputTextField"; onFocusIn = new EventListener(this, "onFocusIn"); onFocusOut = new EventListener(this, "onFocusOut"); onChanged = new EventListener(this, "onChanged"); onSubmit = new EventListener(this, "onSubmit"); _text = string.Empty; maxLength = 0; editable = true; _composing = 0; keyboardInput = Stage.keyboardInput; /* 因为InputTextField定义了ClipRect,而ClipRect是四周缩进了2个像素的(GUTTER),默认的点击测试 * 是使用ClipRect的,那会造成无法点击四周的空白区域。所以这里自定义了一个HitArea */ this.hitArea = new RectHitTest(); this.touchChildren = false; onFocusIn.Add(__focusIn); onFocusOut.AddCapture(__focusOut); onKeyDown.AddCapture(__keydown); onTouchBegin.AddCapture(__touchBegin); onTouchMove.AddCapture(__touchMove); }
static public int Add(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (matchType(l, argc, 2, typeof(FairyGUI.EventCallback0))) { FairyGUI.EventListener self = (FairyGUI.EventListener)checkSelf(l); FairyGUI.EventCallback0 a1; LuaDelegation.checkDelegate(l, 2, out a1); self.Add(a1); pushValue(l, true); return(1); } else if (matchType(l, argc, 2, typeof(FairyGUI.EventCallback1))) { FairyGUI.EventListener self = (FairyGUI.EventListener)checkSelf(l); FairyGUI.EventCallback1 a1; LuaDelegation.checkDelegate(l, 2, out a1); self.Add(a1); pushValue(l, true); return(1); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function to call"); return(2); } catch (Exception e) { return(error(l, e)); } }
public InputTextField() { gameObject.name = "InputTextField"; onFocusIn = new EventListener(this, "onFocusIn"); onFocusOut = new EventListener(this, "onFocusOut"); onChanged = new EventListener(this, "onChanged"); maxLength = int.MaxValue; editable = true; /* 因为InputTextField定义了ClipRect,而ClipRect是四周缩进了2个像素的(GUTTER),默认的点击测试 * 是使用ClipRect的,那会造成无法点击四周的空白区域。所以这里自定义了一个HitArea */ this.hitArea = new RectHitTest(); this.touchChildren = false; _touchMoveDelegate = __touchMove; onFocusIn.Add(__focusIn); onFocusOut.AddCapture(__focusOut); onKeyDown.AddCapture(__keydown); onTouchBegin.AddCapture(__touchBegin); onTouchEnd.AddCapture(__touchEnd); }
static int Add(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes <FairyGUI.EventCallback0>(L, 2)) { FairyGUI.EventListener obj = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1); FairyGUI.EventCallback0 arg0 = (FairyGUI.EventCallback0)ToLua.ToObject(L, 2); obj.Add(arg0); return(0); } else if (count == 2 && TypeChecker.CheckTypes <FairyGUI.EventCallback1>(L, 2)) { FairyGUI.EventListener obj = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1); FairyGUI.EventCallback1 arg0 = (FairyGUI.EventCallback1)ToLua.ToObject(L, 2); obj.Add(arg0); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.EventListener.Add")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Add(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.EventListener), typeof(FairyGUI.EventCallback0))) { FairyGUI.EventListener obj = (FairyGUI.EventListener)ToLua.ToObject(L, 1); FairyGUI.EventCallback0 arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (FairyGUI.EventCallback0)ToLua.ToObject(L, 2); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(FairyGUI.EventCallback0), func) as FairyGUI.EventCallback0; } obj.Add(arg0); return(0); } else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.EventListener), typeof(FairyGUI.EventCallback1))) { FairyGUI.EventListener obj = (FairyGUI.EventListener)ToLua.ToObject(L, 1); FairyGUI.EventCallback1 arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (FairyGUI.EventCallback1)ToLua.ToObject(L, 2); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(FairyGUI.EventCallback1), func) as FairyGUI.EventCallback1; } obj.Add(arg0); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.EventListener.Add")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Add(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { FairyGUI.EventListener obj = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1); FairyGUI.EventCallback1 arg0 = (FairyGUI.EventCallback1)ToLua.CheckDelegate <FairyGUI.EventCallback1>(L, 2); obj.Add(arg0); return(0); } else if (count == 3 && TypeChecker.CheckTypes <LuaInterface.LuaTable>(L, 3)) { FairyGUI.EventListener obj = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1); LuaFunction arg0 = ToLua.CheckLuaFunction(L, 2); LuaTable arg1 = ToLua.ToLuaTable(L, 3); obj.Add(arg0, arg1); return(0); } else if (count == 3 && TypeChecker.CheckTypes <FairyGUI.GComponent>(L, 3)) { FairyGUI.EventListener obj = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1); LuaFunction arg0 = ToLua.CheckLuaFunction(L, 2); FairyGUI.GComponent arg1 = (FairyGUI.GComponent)ToLua.ToObject(L, 3); obj.Add(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.EventListener.Add")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }