Skip to content

Commit af5857f

Browse files
committed
Add ViewportFrame info
1 parent 1a46f82 commit af5857f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

content/en-us/reference/engine/classes/Camera.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,9 @@ properties:
538538
writeCapabilities: []
539539
- name: Camera.ViewportSize
540540
summary: |
541-
The dimensions of the device safe area rectangle on a Roblox client.
542-
The units are in Roblox UI offset units which may be different from
543-
native display pixels.
541+
The dimensions of the device safe area on a Roblox client.
544542
description: |
545-
The device safe area rectangle includes the Roblox top bar area, but does not include any display cutouts.
543+
`Class.Camera.ViewportSize` returns the dimensions of the device safe area on the current screen. The device safe area is a rectangle which includes the Roblox top bar area, but does not include any cutouts in the display. The units of `Class.Camera.ViewportSize` are Roblox UI offset units, which may be different from native display pixels.
546544
547545
<img src="../../../assets/engine-api/enums/ScreenInsets/DeviceSafeInsets.png" width="840"
548546
alt="Mobile device screen with cutout showing device safe area." />
@@ -557,6 +555,12 @@ properties:
557555
Note: `Class.Camera.ViewportSize` is not the actual viewport size the camera uses for rendering. The Camera renders in the fullscreen area. Also the `Class.Camera.FieldOfView` and `Class.Camera.DiagonalFieldOfView` properties are based on the fullscreen area, not `Class.Camera.ViewportSize`.
558556
559557
To learn more about how your experience will run on a device with notches/cutouts, please see [this post](https://devforum.roblox.com/t/notched-screen-support-full-release/2074324/1).
558+
559+
Only one `Class.Camera` has its `Class.Camera.ViewportSize` updated each frame: the `Class.Camera` currently referred to by `Class.Workspace.CurrentCamera`. The `ViewportSize` of all other `Class.Camera`s in your experience won't be updated. This includes `Class.Camera`s that are used for `Class.ViewportFrame`s.
560+
561+
The initial value of `Class.Camera.ViewportSize` is `(1, 1)`. The `Class.Workspace.CurrentCamera`'s `Class.Camera.ViewportSize` is updated once each frame during the render prepare step.
562+
563+
For example, a `Class.ViewportFrame` with `Class.ViewportFrame.CurrentCamera` set to a different `Class.Camera` than the `Class.Workspace.CurrentCamera` will have its `ViewportSize` equal to the initial value of `(1, 1)`.
560564
code_samples:
561565
type: Vector2
562566
tags:

0 commit comments

Comments
 (0)