Struct MousePosition
Represents a mouse position on the screen. Allows to get the position in either window coordinates or viewport coordinates.
Inherited Members
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public struct MousePosition
Constructors
| Improve this Doc View SourceMousePosition(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 SourceInWindow
Gets a value indicating whether this MousePosition is inside the window.
Declaration
public bool InWindow { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
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 |
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 |
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 |
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 SourceGetProjectedPoint(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. |
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. |
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. |