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
A GUI position in point space.
Returns
Type | Description |
|---|---|
| Rect | The 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.
Additional Resources: EditorGUIUtility.PixelsToPoints, EditorGUIUtility.pixelsPerPoint.
PointsToPixels(Vector2)
Convert a Rect from point space to pixel space.
public static Vector2 PointsToPixels(Vector2 position)
Parameters
A GUI rect measured in points.
Returns
Type | Description |
|---|---|
| Vector2 | A rect representing the same area in pixels. |