Description
The Zoom
method in the Editor.GraphicsView
class allows you to adjust the zoom level of the graphics view. This method modifies the current scale of the view based on the provided adjustment factor and centers the zoom operation around a specified position within the view.
Usage
To use the Zoom
method, you need to provide two parameters:
adjust
: A float
value representing the zoom adjustment factor. A value greater than 1.0 will zoom in, while a value less than 1.0 will zoom out.
viewpos
: A Vector2
representing the position in the view around which the zoom operation should be centered.
This method does not return a value.
Example
// Example of using the Zoom method
Editor.GraphicsView graphicsView = new Editor.GraphicsView();
// Zoom in by a factor of 1.2 centered around the point (100, 100)
graphicsView.Zoom(1.2f, new Vector2(100, 100));
// Zoom out by a factor of 0.8 centered around the point (200, 200)
graphicsView.Zoom(0.8f, new Vector2(200, 200));