Show / Hide Table of Contents

    Struct MousePosition

    Represents a mouse position on the screen. Allows to get the position in either window coordinates or viewport coordinates.

    Inherited Members
    System.ValueType.Equals(System.Object)
    System.ValueType.GetHashCode()
    System.ValueType.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: AGS.API
    Assembly: AGS.API.dll
    Syntax
    public struct MousePosition

    Constructors

    | Improve this Doc View Source

    MousePosition(Single, Single, ICoordinates)

    Initializes a new instance of the MousePosition struct.

    Declaration
    public MousePosition(float xWindow, float yWindow, ICoordinates coordinates)
    Parameters
    Type Name Description
    System.Single xWindow

    X position of the mouse in window coordinates.

    System.Single yWindow

    Y position of the mouse in window coordinates.

    ICoordinates coordinates

    Coordinate conversion utilities.

    Properties

    | Improve this Doc View Source

    InWindow

    Gets a value indicating whether this MousePosition is inside the window.

    Declaration
    public bool InWindow { get; }
    Property Value
    Type Description
    System.Boolean

    true if in window; otherwise, false.

    | Improve this Doc View Source

    XMainViewport

    X position of the mouse in the main viewport coordinates (i.e the world coordinates).

    Declaration
    public float XMainViewport { get; }
    Property Value
    Type Description
    System.Single
    | Improve this Doc View Source

    XWindow

    X position of the mouse in window coordinates. Usually this will be less helpful for interacting with the world, for that you'd want to use the viewport coordinates.

    Declaration
    public float XWindow { get; }
    Property Value
    Type Description
    System.Single
    | Improve this Doc View Source

    YMainViewport

    Y position of the mouse in the main viewport coordinates (i.e the world coordinates).

    Declaration
    public float YMainViewport { get; }
    Property Value
    Type Description
    System.Single
    | Improve this Doc View Source

    YWindow

    Y position of the mouse in window coordinates. Usually this will be less helpful for interacting with the world, for that you'd want to use the viewport coordinates.

    Declaration
    public float YWindow { get; }
    Property Value
    Type Description
    System.Single

    Methods

    | Improve this Doc View Source

    GetProjectedPoint(IViewport, IObject)

    Get the mouse position in a specific viewport coordinates, projected onto a specific object's world.

    Declaration
    public PointF GetProjectedPoint(IViewport viewport, IObject projectedInto)
    Parameters
    Type Name Description
    IViewport viewport

    Viewport.

    IObject projectedInto

    Projected into.

    Returns
    Type Description
    PointF

    The projected point.

    | Improve this Doc View Source

    GetViewportX(IViewport)

    Gets the x position of the mouse in a specific viewport coordinates.

    Declaration
    public float GetViewportX(IViewport viewport)
    Parameters
    Type Name Description
    IViewport viewport

    Viewport.

    Returns
    Type Description
    System.Single

    The x position.

    | Improve this Doc View Source

    GetViewportY(IViewport)

    Gets the y position of the mouse in a specific viewport coordinates.

    Declaration
    public float GetViewportY(IViewport viewport)
    Parameters
    Type Name Description
    IViewport viewport

    Viewport.

    Returns
    Type Description
    System.Single

    The y position.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX