GetAspectRect
Reserve layout space for a rectangle with a specific aspect ratio.
Read time 2 minutesLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.IMGUIModule
GetAspectRect(float)
Reserve layout space for a rectangle with a specific aspect ratio.
public static Rect GetAspectRect(float aspect)
Parameters
The aspect ratio of the element (width / height).
Returns
Type | Description |
|---|---|
| Rect | The rect for the control. |
GetAspectRect(float, GUIStyle)
Reserve layout space for a rectangle with a specific aspect ratio.
public static Rect GetAspectRect(float aspect, GUIStyle style)
Parameters
Returns
Type | Description |
|---|---|
| Rect | The rect for the control. |
GetAspectRect(float, GUILayoutOption[])
Reserve layout space for a rectangle with a specific aspect ratio.
public static Rect GetAspectRect(float aspect, params GUILayoutOption[] options)
Parameters
The aspect ratio of the element (width / height).
An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.
Additional Resources: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
Additional Resources: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
Returns
Type | Description |
|---|---|
| Rect | The rect for the control. |
GetAspectRect(float, GUIStyle, GUILayoutOption[])
Reserve layout space for a rectangle with a specific aspect ratio.
public static Rect GetAspectRect(float aspect, GUIStyle style, params GUILayoutOption[] options)
Parameters
The aspect ratio of the element (width / height).
An optional style. If specified, the style's padding value will be added to the sizes of the returned rectangle & the style's margin values will be used for spacing.
An optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.
Additional Resources: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
Additional Resources: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.
Returns
Type | Description |
|---|---|
| Rect | The rect for the control. |