Class PanAndZoomable
This manipulator allows panning and zooming of the content.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class PanAndZoomable : Manipulator, IManipulator
Remarks
This manipulator is used on the Canvas UI element.
Constructors
PanAndZoomable(ZoomChangedDelegate, ScrollOffsetChangedDelegate, GrabModeChangedDelegate)
Constructs a new instance of PanAndZoomable.
Declaration
public PanAndZoomable(PanAndZoomable.ZoomChangedDelegate zoomChanged, PanAndZoomable.ScrollOffsetChangedDelegate scrollOffsetChanged, PanAndZoomable.GrabModeChangedDelegate grabModeChanged)
Parameters
| Type | Name | Description |
|---|---|---|
| PanAndZoomable.ZoomChangedDelegate | zoomChanged | A delegate that is called when the zoom level changes. |
| PanAndZoomable.ScrollOffsetChangedDelegate | scrollOffsetChanged | A delegate that is called when the scroll offset changes. |
| PanAndZoomable.GrabModeChangedDelegate | grabModeChanged | A delegate that is called when the grab mode changes. |
Properties
controlScheme
The control scheme used to interact with the canvas.
Declaration
public CanvasControlScheme controlScheme { get; set; }
Property Value
| Type | Description |
|---|---|
| CanvasControlScheme |
See Also
dampingEffectDurationMs
The duration of the damping effect in milliseconds.
Declaration
public int dampingEffectDurationMs { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
grabMode
The grab mode.
Declaration
public GrabMode grabMode { get; }
Property Value
| Type | Description |
|---|---|
| GrabMode |
maxZoom
The maximum zoom level.
Declaration
public float maxZoom { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
minZoom
The minimum zoom level.
Declaration
public float minZoom { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
panMultiplier
The pan multiplier.
Declaration
public float panMultiplier { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
primaryManipulator
The primary manipulator. This manipulator will be used without any modifier key.
Declaration
public CanvasManipulator primaryManipulator { get; set; }
Property Value
| Type | Description |
|---|---|
| CanvasManipulator |
See Also
scrollDirection
The scroll direction.
Declaration
public ScrollDirection scrollDirection { get; set; }
Property Value
| Type | Description |
|---|---|
| ScrollDirection |
scrollOffset
The scroll offset.
Declaration
public Vector2 scrollOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
scrollSpeed
The speed at which the canvas scrolls.
Declaration
public float scrollSpeed { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
useSpaceBar
Whether to use the space bar to pan the canvas.
Declaration
public bool useSpaceBar { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
zoom
The zoom level.
Declaration
public Vector2 zoom { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
zoomMultiplier
The zoom multiplier.
Declaration
public float zoomMultiplier { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
zoomSpeed
The speed at which the manipulator zooms.
Declaration
public float zoomSpeed { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
ApplyZoom(Vector2, Vector2)
Applies a zoom delta to the target.
Declaration
public void ApplyZoom(Vector2 pivot, Vector2 delta)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | pivot | The pivot point. |
| Vector2 | delta | The zoom delta. |
GetGrabModeUssClassName(GrabMode)
Declaration
public static string GetGrabModeUssClassName(GrabMode enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| GrabMode | enumValue |
Returns
| Type | Description |
|---|---|
| string |
RegisterCallbacksOnTarget()
Called to register event callbacks on the target element.
Declaration
protected override void RegisterCallbacksOnTarget()
Overrides
SetScrollOffsetWithoutNotify(Vector2)
Sets the scroll offset without notifying the scroll offset changed delegate.
Declaration
public void SetScrollOffsetWithoutNotify(Vector2 newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | newValue | The new scroll offset. |
UnregisterCallbacksFromTarget()
Called to unregister event callbacks from the target element.
Declaration
protected override void UnregisterCallbacksFromTarget()