Vector2 ScenePosition { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The ScenePosition property provides the position of the mouse cursor within the Editor.GraphicsScene. This property is useful for determining the exact location of the mouse in the scene, which can be critical for tasks such as object selection, manipulation, or interaction within the editor environment.

Usage

To use the ScenePosition property, you need to have an instance of the GraphicsMouseEvent struct. This property is read-only and returns a Vector2 representing the x and y coordinates of the mouse cursor within the scene.

Example

// Example of accessing the ScenePosition property

// Assume 'mouseEvent' is an instance of GraphicsMouseEvent
Vector2 mouseScenePosition = mouseEvent.ScenePosition;

// Use the scene position for further processing
float x = mouseScenePosition.x;
float y = mouseScenePosition.y;

// Example: Log the scene position
// LogPosition(x, y); // Replace with appropriate logging or handling method