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. |
Remarks
Additional Resources: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight
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. |
Remarks
Additional Resources: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight
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 .
GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
styleGUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
Returns
Type | Description |
|---|---|
| Rect | The rect for the control. |
Remarks
Additional Resources: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight
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 value will be added to the sizes of the returned rectangle & the style's values will be used for spacing.
paddingmarginAn optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the .
GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
styleGUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
Returns
Type | Description |
|---|---|
| Rect | The rect for the control. |
Remarks
Additional Resources: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight