Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ViewportInterface

A viewport is a sub-area of the entire rendering surface, see https://threejs.org/docs/#api/renderers/WebGLRenderer.setViewport

Hierarchy

Index

Properties

bottom

bottom: number

Bottom edge of viewport [0..1], where 0 is bottom

camera

camera: Camera

Camera used for rendering

height

height: number

Height of viewport [0..1]

left

left: number

Left edge of viewport [0…1], where 0 is left

name

name: string

Name of the viewport

width

width: number

Width of viewport [0..1]

Methods

contains

  • contains(x: number, y: number): boolean
  • Check if provided screen coordinate is within the viewport

    Parameters

    • x: number

      Screen-space coordinate relative to top-left corner of viewport [px]

    • y: number

      Screen-space coordinate relative to top-left corner of viewport [px]

    Returns boolean

setDimensions

  • setDimensions(left: number, bottom: number, width: number, height: number): void
  • Set viewport offset and size on screen

    Parameters

    • left: number

      Left edge of viewport [0..1], where 0 is left

    • bottom: number

      Bottom edge of viewport [0..1], where 0 is bottom

    • width: number

      Width of viewport [0..1]

    • height: number

      Height of viewport [0..1]

    Returns void

Generated using TypeDoc