BBGamelib.CCTouchDispatcher.addTargetedDelegate C# (CSharp) Method

addTargetedDelegate() public method

public addTargetedDelegate ( CCTouchOneByOneDelegate aDelegate, int priority, bool swallowsTouches ) : void
aDelegate CCTouchOneByOneDelegate
priority int
swallowsTouches bool
return void
		public void addTargetedDelegate(CCTouchOneByOneDelegate aDelegate, int priority, bool swallowsTouches)
		{
			CCTouchHandler handler = new CCTargetedTouchHandler(aDelegate, priority, swallowsTouches);
			if( ! locked ) {
				forceAddHandler(handler, targetedHandlers);
			} else {
				if(!removeDelegate(aDelegate, handlersToRemove)){
					handlersToAdd.Add(handler);
					toAdd = true;
				}
			}
		}
		#endregion

Usage Example

Beispiel #1
0
        /** Register with more priority than CCMenu's but don't swallow touches. */
        protected override void registerWithTouchDispatcher()
        {
            CCTouchDispatcher dispatcher = CCDirector.sharedDirector.touchDispatcher;
            int priority = _touchPriority;

            dispatcher.addTargetedDelegate(this, priority, false);
        }