AddCapture() public method

public AddCapture ( EventCallback1 callback ) : void
callback EventCallback1
return void
示例#1
0
        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 int AddCapture(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 2);
            FairyGUI.EventListener  obj  = (FairyGUI.EventListener)ToLua.CheckObject(L, 1, typeof(FairyGUI.EventListener));
            FairyGUI.EventCallback1 arg0 = null;
            LuaTypes funcType2           = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (FairyGUI.EventCallback1)ToLua.CheckObject(L, 2, typeof(FairyGUI.EventCallback1));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(FairyGUI.EventCallback1), func) as FairyGUI.EventCallback1;
            }

            obj.AddCapture(arg0);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#3
0
        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);
        }
示例#4
0
        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 public int AddCapture(IntPtr l)
 {
     try {
         FairyGUI.EventListener  self = (FairyGUI.EventListener)checkSelf(l);
         FairyGUI.EventCallback1 a1;
         LuaDelegation.checkDelegate(l, 2, out a1);
         self.AddCapture(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#6
0
 static int AddCapture(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FairyGUI.EventListener  obj  = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1);
         FairyGUI.EventCallback1 arg0 = (FairyGUI.EventCallback1)ToLua.CheckDelegate <FairyGUI.EventCallback1>(L, 2);
         obj.AddCapture(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }