You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en-us/reference/engine/classes/Camera.yaml
+79-36Lines changed: 79 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -239,7 +239,10 @@ properties:
239
239
`Class.Camera.FieldOfView|FieldOfView` for a more general explanation of
240
240
field of view.
241
241
242
-
Note that `DiagonalFieldOfView` represents the field of view that is visible by the `Class.Camera` rendering into the fullscreen area which may be occluded by notches or screen cutouts on some devices. See `Class.Camera.ViewportSize|ViewportSize` for more information.
242
+
Note that `DiagonalFieldOfView` represents the field of view that is
243
+
visible by the `Class.Camera` rendering into the fullscreen area which
244
+
may be occluded by notches or screen cutouts on some devices. See `Class.
245
+
Camera.ViewportSize|ViewportSize` for more information.
243
246
code_samples:
244
247
type: float
245
248
tags:
@@ -274,7 +277,10 @@ properties:
274
277
- Increasing FOV when the player is "sprinting" to give the impression of
275
278
a lack of control.
276
279
277
-
Note that `FieldOfView` represents the field of view that is visible by the `Class.Camera` rendering into the fullscreen area which may be occluded by notches or screen cutouts on some devices. See `Class.Camera.ViewportSize|ViewportSize` for more information.
280
+
Note that `FieldOfView` represents the field of view that is visible by
281
+
the `Class.Camera` rendering into the fullscreen area which may be
282
+
occluded by notches or screen cutouts on some devices. See `Class.Camera.
283
+
ViewportSize|ViewportSize` for more information.
278
284
code_samples:
279
285
type: float
280
286
tags: []
@@ -540,26 +546,53 @@ properties:
540
546
summary: |
541
547
The dimensions of the device safe area on a Roblox client.
542
548
description: |
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.
alt="Mobile device screen with cutout showing device safe area." />
547
558
548
-
Note: `Class.Camera.ViewportSize` is not equal to the fullscreen area size on displays with cutouts or notches. To obtain the fullscreen area size on all displays, you can query the `AbsoluteSize` property of a `Class.ScreenGui` with `ScreenInsets=None`. See `Enum.ScreenInsets` for a more information about how screen areas are defined.
549
-
`Class.Camera.ViewportSize` is not equal to the fullscreen size in order to improve cross-platform compatibility and backwards compatibility with legacy experiences.
alt="Mobile device screen with cutout showing fullscreen area." />
553
571
554
-
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`.
572
+
Note: `Class.Camera.ViewportSize` is not the actual viewport size the
573
+
camera uses for rendering. The Camera renders in the fullscreen area.
574
+
Also the `Class.Camera.FieldOfView` and `Class.Camera.
575
+
DiagonalFieldOfView` properties are based on the fullscreen area, not
576
+
`Class.Camera.ViewportSize`.
555
577
556
-
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).
557
-
558
-
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.
559
-
560
-
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.
561
-
562
-
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)`.
578
+
To learn more about how your experience will run on a device with notches/
579
+
cutouts, please see [this post](https://devforum.roblox.com/t/
580
+
notched-screen-support-full-release/2074324/1).
581
+
582
+
Only one `Class.Camera` has its `Class.Camera.ViewportSize` updated each
583
+
frame: the `Class.Camera` currently referred to by `Class.Workspace.
584
+
CurrentCamera`. The `ViewportSize` of all other `Class.Camera`s in your
585
+
experience won't be updated. This includes `Class.Camera`s that are used
586
+
for `Class.ViewportFrame`s.
587
+
588
+
The initial value of `Class.Camera.ViewportSize` is `(1, 1)`. The `Class.
589
+
Workspace.CurrentCamera`'s `Class.Camera.ViewportSize` is updated once
590
+
each frame during the render prepare step.
591
+
592
+
For example, a `Class.ViewportFrame` with `Class.ViewportFrame.
593
+
CurrentCamera` set to a different `Class.Camera` than the `Class.
594
+
Workspace.CurrentCamera` will have its `ViewportSize` equal to the
595
+
initial value of `(1, 1)`.
563
596
code_samples:
564
597
type: Vector2
565
598
tags:
@@ -1177,27 +1210,35 @@ methods:
1177
1210
at a given depth from the `Class.Camera`, orientated in the camera's
1178
1211
direction. Does not account for the `Enum.ScreenInsets|CoreUISafeInsets` inset.
1179
1212
description: |
1180
-
This function creates a unit `Datatype.Ray` from a 2D position in device safe viewport coordinates,
1181
-
defined in pixels. That is, `(0, 0)` corresponds to the top-left point of the Roblox top bar. The input
1182
-
2D position does **not** account for the `Enum.ScreenInsets|CoreUISafeInsets` inset, but it does
1213
+
This function creates a unit `Datatype.Ray` from a 2D position in device
1214
+
safe viewport coordinates,
1215
+
defined in pixels. That is, `(0, 0)` corresponds to the top-left point of
1216
+
the Roblox top bar. The input 2D position does **not** account for the
1217
+
`Enum.ScreenInsets|CoreUISafeInsets` inset, but it does
1183
1218
account for any `Enum.ScreenInsets|DeviceSafeInsets`.
1184
1219
1185
-
<img src="../../../assets/engine-api/classes/Camera/DeviceSafeViewportCoordinates.png" width="840" alt="Diagram showing the origin of the device safe area viewport coordinate system." />
0 commit comments