handleEvent() private method

private handleEvent ( ApplicationEvent applicationEvent ) : void
applicationEvent ApplicationEvent
return void
コード例 #1
0
        public override bool OnTouchEvent(MotionEvent e)
        {
            for (int i = 0; i != ApplicationEvent.TouchCount; ++i)
            {
                theEvent.TouchesOn[i] = false;
            }

            int count = (e.PointerCount <= ApplicationEvent.TouchCount) ? e.PointerCount : ApplicationEvent.TouchCount;

            for (int i = 0; i != count; ++i)
            {
                int id = e.GetPointerId(i);
                theEvent.TouchLocations[id] = new Vector2(e.GetX(i), e.GetY(i));
                theEvent.TouchesOn[id]      = (e.Action != MotionEventActions.Up);
            }

            theEvent.Type = ApplicationEventTypes.Touch;
            application.handleEvent(theEvent);
            return(true);
        }