Description
The FromScene
method in the Editor.GraphicsItem
class is used to convert a position from the scene's coordinate system to the local coordinate system of the graphics item. This is useful when you need to determine the local position of a point that is defined in the scene's global space.
Usage
To use the FromScene
method, you need to have an instance of GraphicsItem
. You can then call this method by passing a Vector2
representing the position in the scene's coordinate system. The method will return a Vector2
that represents the equivalent position in the local coordinate system of the graphics item.
Example
// Assume 'graphicsItem' is an instance of Editor.GraphicsItem
Vector2 scenePosition = new Vector2(100, 200);
Vector2 localPosition = graphicsItem.FromScene(scenePosition);
// 'localPosition' now contains the position relative to the graphics item.