Description
The Scale
property of the Editor.GraphicsView
class represents the scaling factor applied to the graphics view. It is a Vector2
type, which means it can scale the view differently along the X and Y axes. This property is useful for zooming in and out of the view, allowing for detailed inspection or a broader overview of the scene.
Usage
To adjust the scale of the graphics view, you can set the Scale
property with a new Vector2
value. Increasing the values will zoom in, while decreasing them will zoom out. Ensure that the values are positive to maintain a valid scale.
Example
// Example of setting the Scale property
GraphicsView graphicsView = new GraphicsView();
// Set the scale to 2x on both axes
graphicsView.Scale = new Vector2(2.0f, 2.0f);
// Set the scale to 1.5x on the X axis and 1.0x on the Y axis
graphicsView.Scale = new Vector2(1.5f, 1.0f);