Nez.Portable/UI/Stage.cs
/// <summary>
/// Mouse or touch is down this frame.
/// </summary>
/// <param name="inputPos">location of cursor</param>
/// <param name="over">element under cursor</param>
Mouse or touch is down this frame.
Mouse or touch is down this frame .
void updateInputDown(Vector2 inputPos, Element over)
        {
            if (_keyboardFocusElement != null && over != _keyboardFocusElement)
                setKeyboardFocus(null);
            if (over is IInputListener)
            {
                var elementLocal = over.stageToLocalCoordinates(inputPos);
                var listener = over as IInputListener;
                if (listener.onMousePressed(elementLocal))
                    _inputFocusListeners.Add(over);
            }
        }
void updateInputDown ( Vector2 inputPos , Element over ) { if ( _keyboardFocusElement != null && over != _keyboardFocusElement ) setKeyboardFocus ( null ) ; if ( over is IInputListener ) { var elementLocal = over . stageToLocalCoordinates ( inputPos ) ; var listener = over as IInputListener ; if ( listener . onMousePressed ( elementLocal ) ) _inputFocusListeners . Add ( over ) ; } }
Mouse or touch is down this frame.
Mouse or touch is down this frame .
// lose keyboard focus if we click outside of the keyboardFocusElement // if we are over an element and the left button was pressed we notify our listener // add the listener to be notified for all onMouseDown and onMouseUp events
inputPos
Vector2
location of cursor
location of cursor
over
Element
element under cursor
element under cursor