Class ResizeHandle
An element that can be dragged to resize another element.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class ResizeHandle : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle
Constructors
ResizeHandle()
Default Constructor.
Declaration
public ResizeHandle()
ResizeHandle(VisualElement)
Constructor with a target VisualElement.
Declaration
public ResizeHandle(VisualElement target)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | target | The element that will be resized when the handle is dragged. |
Fields
ussClassName
The ResizeHandle main styling class.
Declaration
public const string ussClassName = "appui-resize-handle"
Field Value
| Type | Description |
|---|---|
| string |
variantUssClassName
The ResizeHandle variant styling class.
Declaration
public const string variantUssClassName = "appui-resize-handle--"
Field Value
| Type | Description |
|---|---|
| string |
Properties
dragDirection
The direction in which the handle can be dragged.
Declaration
public Draggable.DragDirection dragDirection { get; set; }
Property Value
| Type | Description |
|---|---|
| Draggable.DragDirection |
sizeModifier
Optional callback invoked during resize to modify the size before it is applied to the target. The first parameter is the computed new size, the second is the original size at drag start. The callback must return the adjusted size to apply.
Declaration
public Func<Vector2, Vector2, Vector2> sizeModifier { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<Vector2, Vector2, Vector2> |
target
The target VisualElement that will be resized when the handle is dragged.
Declaration
public VisualElement target { get; set; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
threshold
The threshold in pixels that the handle must be dragged before it starts to move.
Declaration
public float threshold { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
GetDirectionUssClassName(DragDirection)
Declaration
public static string GetDirectionUssClassName(Draggable.DragDirection enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Draggable.DragDirection | enumValue |
Returns
| Type | Description |
|---|---|
| string |
Events
resizeEnded
Event triggered when the resize operation ends.
Declaration
public event Action<ResizeHandle> resizeEnded
Event Type
| Type | Description |
|---|---|
| Action<ResizeHandle> |
resizeStarted
Event triggered when the resize operation starts.
Declaration
public event Action<ResizeHandle> resizeStarted
Event Type
| Type | Description |
|---|---|
| Action<ResizeHandle> |