Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Handles.DrawCamera

static function DrawCamera(position: Rect, camera: Camera, drawMode: DrawCameraMode = DrawCameraMode.Normal): void;
static void DrawCamera(Rect position, Camera camera, DrawCameraMode drawMode = DrawCameraMode.Normal);
static def DrawCamera(position as Rect, camera as Camera, drawMode as DrawCameraMode = DrawCameraMode.Normal) as void

Parameters

positionThe area to draw the camera within in GUI coordinates.
cameraThe camera to draw.
drawModeHow the camera is drawn (textured, wireframe, etc.).

Description

Draws a camera inside a rectangle.

This function alse sets Camera.current to camera. It sets the camera's pixelRect to position.

Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.