Vector2 MousePosition { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The MousePosition property of the Editor.SceneViewportWidget class provides the current position of the mouse cursor within the scene viewport. This property is static, meaning it is shared across all instances of SceneViewportWidget and can be accessed without creating an instance of the class.

Usage

To access the current mouse position within the scene viewport, use the MousePosition property. This property returns a Vector2 representing the x and y coordinates of the mouse cursor.

Example usage:

Vector2 currentMousePosition = Editor.SceneViewportWidget.MousePosition;
float mouseX = currentMousePosition.x;
float mouseY = currentMousePosition.y;

Example

Vector2 currentMousePosition = Editor.SceneViewportWidget.MousePosition;
float mouseX = currentMousePosition.x;
float mouseY = currentMousePosition.y;