Пример #1
0
        /// <summary>
        /// Determines whether the specified mouse button is down.
        /// </summary>
        /// <param name="action"></param>
        /// <param name="button">The button.</param>
        /// <param name="region"></param>
        /// <returns>
        ///   <c>true</c> if the specified mouse button is down; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsDown(this IInputContext action, MouseButtons button, Rectangle region)
        {
            var state = action.Current.MouseState;

            return(action.IsDown(button) && region.Contains(state.X, state.Y));
        }