InternalGetMousePosition() protected method

Internal function to get the mouse position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.
protected InternalGetMousePosition ( ) : Vector2i
return Vector2i
コード例 #1
0
ファイル: Mouse.cs プロジェクト: Yozer/NanoWar
 ////////////////////////////////////////////////////////////
 /// <summary>
 /// Get the current position of the mouse
 /// </summary>
 /// This function returns the current position of the mouse
 /// cursor relative to a window.
 /// <param name="relativeTo">Reference window</param>
 /// <returns>Current position of the mouse</returns>
 ////////////////////////////////////////////////////////////
 public static Vector2i GetPosition(Window relativeTo)
 {
     if (relativeTo != null)
         return relativeTo.InternalGetMousePosition();
     else
         return sfMouse_getPosition(IntPtr.Zero);
 }
コード例 #2
0
ファイル: Mouse.cs プロジェクト: stupid-genius/ss13remake
 ////////////////////////////////////////////////////////////
 /// <summary>
 /// Get the current position of the mouse
 /// </summary>
 /// This function returns the current position of the mouse
 /// cursor relative to a window.
 /// <param name="relativeTo">Reference window</param>
 /// <returns>Current position of the mouse</returns>
 ////////////////////////////////////////////////////////////
 public static Vector2i GetPosition(Window relativeTo)
 {
     if (relativeTo != null)
     {
         return(relativeTo.InternalGetMousePosition());
     }
     else
     {
         return(sfMouse_getPosition(IntPtr.Zero));
     }
 }
コード例 #3
0
 /// <summary>
 /// Gets the current position of the mouse.
 /// </summary>
 /// This function returns the current position of the mouse
 /// cursor relative to a window.
 /// <param name="relativeTo">Reference window.</param>
 /// <returns>Current position of the mouse.</returns>
 public static Vector2i GetPosition(Window relativeTo = null)
 {
     return(relativeTo?.InternalGetMousePosition() ?? sfMouse_getPosition(IntPtr.Zero));
 }