예제 #1
0
        public void InputDown(Bridge.Html5.Touch touch)
        {
            if (_identifier != -1)
            {
                return;
            }

            _isInputDown = true;

            if (!_actionConfiguration.Circle.Collision(GetCurrentTouchPosition(touch)))
            {
                if (_isButtonDown)
                {
                    _isButtonDown = false;
                    _isButtonUp   = true;
                }
                return;
            }

            // at this point we know we are on the button
            if (!_isButtonDown)
            {
                _identifier   = touch.Identifier;
                _isButtonDown = true;
                _isButtonUp   = false;
            }
        }
 private void InputTouchMove(Bridge.Html5.Touch touch)
 {
     foreach (var key in Events.Keys)
     {
         Events[key].As <Events>().InputMove(touch);
     }
 }
예제 #3
0
 private Circle GetCurrentTouchPosition(Bridge.Html5.Touch touch)
 {
     return(new Circle(
                _resolution.GetEventX(_wrapper, touch),
                _resolution.GetEventY(_wrapper, touch),
                _resolution.Multiply(6)
                ));
 }
예제 #4
0
        public void InputMove(Bridge.Html5.Touch touch)
        {
            if (_isButtonDown && !_actionConfiguration.Circle.Collision(GetCurrentTouchPosition(touch)) && _identifier == touch.Identifier)
            {
                _isButtonDown = false;
                _isButtonUp   = true;
                _identifier   = -1;
                return;
            }

            if (!_isButtonDown && _actionConfiguration.Circle.Collision(GetCurrentTouchPosition(touch)))
            {
                _isButtonDown = true;
                _isButtonUp   = false;
                _identifier   = touch.Identifier;
            }
        }
예제 #5
0
        public void InputUp(Bridge.Html5.Touch touch)
        {
            if (_identifier == -1 || _identifier != touch.Identifier)
            {
                return;
            }

            _isInputDown = false;

            if (_isButtonDown)
            {
                _isButtonDown         = false;
                _isButtonUp           = true;
                _onceOnButtonDownLock = false;
                _identifier           = -1;
            }

            if (_applyFullscreen)
            {
                _applyFullscreen = false;
                EventsExtensions.ApplyFullscreen(_wrapper);
            }
        }
예제 #6
0
 private void InputTouchMove(Bridge.Html5.Touch touch)
 {
     Up.As <Events>().InputMove(touch);
 }
예제 #7
0
 private void InputTouchUp(Bridge.Html5.Touch touch)
 {
     Up.As <Events>().InputUp(touch);
 }
예제 #8
0
 private void InputTouchDown(Bridge.Html5.Touch touch)
 {
     Up.As <Events>().InputDown(touch);
 }