기술 자료

Unity Engine

Unity Engine

AlignRectToDevice

Align a local space rectangle to the pixel grid.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.IMGUIModule

AlignRectToDevice(Rect, int, int)

Align a local space rectangle to the pixel grid.
public static Rect AlignRectToDevice(Rect rect, out int widthInPixels, out int heightInPixels)

Parameters

rect


widthInPixels

Width, in pixel units, of the axis-aligned bounding box that encompasses the aligned points.

heightInPixels

Height, in pixel units, of the axis-aligned bounding box that encompasses the aligned points.

Returns

Type

Description

RectThe aligned rectangle in local space.

Remarks

Aligns the top-left and bottom-right corners of the provided local space rectangle to the pixel grid and returns the local space axis-aligned bounding box that encompasses those points.

AlignRectToDevice(Rect)

Align a local space rectangle to the pixel grid.
public static Rect AlignRectToDevice(Rect rect)

Parameters

rect

Returns

Type

Description

RectThe aligned rectangle in local space.

Remarks

Aligns the top-left and bottom-right corners of the provided local space rectangle to the pixel grid and returns the local space axis-aligned bounding box that encompasses those points.