ドキュメント

Unity Engine

Unity Engine

PointsToPixels

Converts a position from point to pixel space.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

PointsToPixels(Rect)

Converts a position from point to pixel space.
public static Rect PointsToPixels(Rect rect)

Parameters

rect

A GUI position in point space.

Returns

Type

Description

RectThe same position in pixel space.

Remarks

Convert from point space to pixel space.
Use this for determining the resolution and positioning of custom GUI content, such as render textures.

PointsToPixels(Vector2)

Convert a Rect from point space to pixel space.
public static Vector2 PointsToPixels(Vector2 position)

Parameters

position

A GUI rect measured in points.

Returns

Type

Description

Vector2A rect representing the same area in pixels.