기술 자료

Unity Engine

Unity Engine

GetAspectRect

Reserve layout space for a rectangle with a specific aspect ratio.
읽는 시간 2분최근 업데이트: 한 달 전

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

aspect

The aspect ratio of the element (width / height).

Returns

Type

Description

RectThe 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

aspect

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.

Returns

Type

Description

RectThe 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

aspect

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.

Returns

Type

Description

RectThe 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

aspect

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.

Returns

Type

Description

RectThe rect for the control.