FairyGUI.EventListener.AddCapture C# (CSharp) Method

AddCapture() public method

public AddCapture ( EventCallback1 callback ) : void
callback EventCallback1
return void
        public void AddCapture(EventCallback1 callback)
        {
            if (_bridge == null)
                _bridge = this.owner.GetEventBridge(_type);

            _bridge.AddCapture(callback);
        }

Usage Example

示例#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);
        }
All Usage Examples Of FairyGUI.EventListener::AddCapture