Loading...
Searching...
No Matches
CityBuilderCore.IMouseInput Interface Reference

Detailed Description

provides access to the current location of the players pointer

Inheritance diagram for CityBuilderCore.IMouseInput:
CityBuilderCore.CameraController CityBuilderCore.CameraMouseInput

Public Member Functions

Ray GetRay (bool applyOffset=false)
 creates a ray under the players mouse that points in the cameras direction
can be used to check whats currently under the player pointer
 
Vector3 GetMousePosition (bool applyOffset=false)
 calculates absolute world position on the map that the pointer is currently over
 
Vector2 GetMouseScreenPosition (bool applyOffset=false)
 calculates the current position of the players pointer in screen coordinates
 
Vector2Int GetMouseGridPosition (bool applyOffset=false)
 calculates the point on the map that the pointer is currently over
 

Member Function Documentation

◆ GetMouseGridPosition()

Vector2Int CityBuilderCore.IMouseInput.GetMouseGridPosition ( bool applyOffset = false)

calculates the point on the map that the pointer is currently over

Parameters
applyOffsetwhether the touch offset should be applied
Returns
a grid point on the map

Implemented in CityBuilderCore.CameraController, and CityBuilderCore.CameraMouseInput.

◆ GetMousePosition()

Vector3 CityBuilderCore.IMouseInput.GetMousePosition ( bool applyOffset = false)

calculates absolute world position on the map that the pointer is currently over

Parameters
applyOffsetwhether the touch offset should be applied
Returns
a position on the map

Implemented in CityBuilderCore.CameraController, and CityBuilderCore.CameraMouseInput.

◆ GetMouseScreenPosition()

Vector2 CityBuilderCore.IMouseInput.GetMouseScreenPosition ( bool applyOffset = false)

calculates the current position of the players pointer in screen coordinates

Parameters
applyOffsetwhether the touch offset should be applied
Returns
screen space position of the pointer

Implemented in CityBuilderCore.CameraController, and CityBuilderCore.CameraMouseInput.

◆ GetRay()

Ray CityBuilderCore.IMouseInput.GetRay ( bool applyOffset = false)

creates a ray under the players mouse that points in the cameras direction
can be used to check whats currently under the player pointer

Parameters
applyOffsetwhether the touch offset should be applied
Returns
a ray coming from the pointer

Implemented in CityBuilderCore.CameraController, and CityBuilderCore.CameraMouseInput.