Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PointsToPixels

Converts a position from point to pixel space.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor

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.