Resizable
Allows resizing gameobject by size or scale.
Options
Interactable
boolAllow users to change the size of the GameObject.
Resize Directions
Resizable.DirectionsAllowed resizing directions.
Type
ResizeTypeResize type.
SizeResize by changing size of the gameobject.
ScaleResize by changing scale of the gameobject.
Include Corners
boolAllow resize when cursor in the one of the corners. Should be disabled to use together with Rotatable component.
Integer Size
boolIf enabled size is rounded to the integer number. Reason: size can be float number if gameobject is rotated.
Update RectTransform
boolChange RectTransform size.
Update LayoutElement
boolChange LayoutElement size.
Active Region
floatDistance from border where resize allowed.
Min Size
Vector2Minimal size in points, for the
Scaletype limits is checked against width * scale.x and height * scale.y.Max Size
Vector2Maximum size in points, for theScaletype limits is checked against width * scale.x and height * scale.y.Not applied if size is zero.Stop At Parent Borders
boolIf enabled then the component cannot be resized to exceed the parent borders.
Keep Aspect Ratio
boolAspect ratio applied after MinSize and MaxSize, so if default aspect ratio not equal MinSize and MaxSize aspect ratio then real size may be outside limit with one of the axis.
Cursors
CursorsCustom cursors to the allowed resize state.
Snap Grids
List<SnapGridBase>Snap Distance
Vector2Maximum distance to lines where snapping is available.
Events
OnStartResize
UnityEvent<Resizable>OnResize
UnityEvent<Resizable>OnEndResize
UnityEvent<Resizable>OnResizeDelta =
UnityEvent<Resizable, Resizable.Regions, Vector2>OnResizeDirectionsChanged
UnityEvent<Resizable>OnTargetChanged
UnityEvent<Resizable>
Properties
Target
RectTransformTarget to resize; the self is by default.
Resize Children With Parent
There are a few ways to resize children with parent:
Use
RectTransform anchorsto set children size relative to parent with padding from borders.Probably setting anchors to horizontal stretch (for the labels or buttons) or horizontal and vertical stretch (for the long text or ListView) will be enough.
Video about anchors.
Add Layout Group (
Horizontal Layout Group,Vertical Layout Group,Grid Layout Group, EasyLayout) to parent with enabledControl Child Sizeoptions.It is a more complex way, and it will be harder to achieve the desired result.
If you want to add/remove/enable/disable children from a script and automatically reposition them after this, then Layout Group is the right way to do this.