Skip to content

Commit d891dea

Browse files
committed
line wrapping
1 parent cf4d2e7 commit d891dea

File tree

1 file changed

+79
-36
lines changed

1 file changed

+79
-36
lines changed

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

Lines changed: 79 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,10 @@ properties:
239239
`Class.Camera.FieldOfView|FieldOfView` for a more general explanation of
240240
field of view.
241241
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.
243246
code_samples:
244247
type: float
245248
tags:
@@ -274,7 +277,10 @@ properties:
274277
- Increasing FOV when the player is "sprinting" to give the impression of
275278
a lack of control.
276279
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.
278284
code_samples:
279285
type: float
280286
tags: []
@@ -540,26 +546,53 @@ properties:
540546
summary: |
541547
The dimensions of the device safe area on a Roblox client.
542548
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.
544-
545-
<img src="../../../assets/engine-api/enums/ScreenInsets/DeviceSafeInsets.png" width="840"
549+
`Class.Camera.ViewportSize` returns the dimensions of the device safe
550+
area on the current screen. The device safe area is a rectangle which
551+
includes the Roblox top bar area, but does not include any cutouts in the
552+
display. The units of `Class.Camera.ViewportSize` are Roblox UI offset
553+
units, which may be different from native display pixels.
554+
555+
<img src="../../../assets/engine-api/enums/ScreenInsets/DeviceSafeInsets.
556+
png" width="840"
546557
alt="Mobile device screen with cutout showing device safe area." />
547558
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.
550-
551-
<img src="../../../assets/engine-api/enums/ScreenInsets/None.png" width="840"
559+
Note: `Class.Camera.ViewportSize` is not equal to the fullscreen area
560+
size on displays with cutouts or notches. To obtain the fullscreen area
561+
size on all displays, you can query the `AbsoluteSize` property of a
562+
`Class.ScreenGui` with `ScreenInsets=None`. See `Enum.ScreenInsets` for a
563+
more information about how screen areas are defined.
564+
`Class.Camera.ViewportSize` is not equal to the fullscreen size in order
565+
to improve cross-platform compatibility and backwards compatibility with
566+
legacy experiences.
567+
568+
<img src="../../../assets/engine-api/enums/ScreenInsets/None.png"
569+
width="840"
552570
alt="Mobile device screen with cutout showing fullscreen area." />
553571
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`.
555577
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)`.
563596
code_samples:
564597
type: Vector2
565598
tags:
@@ -1177,27 +1210,35 @@ methods:
11771210
at a given depth from the `Class.Camera`, orientated in the camera's
11781211
direction. Does not account for the `Enum.ScreenInsets|CoreUISafeInsets` inset.
11791212
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
11831218
account for any `Enum.ScreenInsets|DeviceSafeInsets`.
11841219
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." />
1220+
<img src="../../../assets/engine-api/classes/Camera/
1221+
DeviceSafeViewportCoordinates.png" width="840" alt="Diagram showing the
1222+
origin of the device safe area viewport coordinate system." />
11861223
1187-
The `Datatype.Ray` originates from the `Datatype.Vector3` equivalent of the 2D position in the
1188-
world at the given depth (in studs) away from the `Class.Camera`.
1224+
The `Datatype.Ray` originates from the `Datatype.Vector3` equivalent of the 2D position in the world at the given depth (in studs) away from the
1225+
`Class.Camera`.
11891226
1190-
Note that UI instances use a different coordinate system. `Class.GuiObject.AbsolutePosition` uses
1191-
the `Enum.ScreenInsets|CoreUISafeInsets` viewport coordinate system, while this function uses the
1192-
`Enum.ScreenInsets|DeviceSafeInsets` viewport coordinate system. If you would like to specify
1193-
position in core UI coordinates, please use
1227+
Note that UI instances use a different coordinate system. `Class.
1228+
GuiObject.AbsolutePosition` uses
1229+
the `Enum.ScreenInsets|CoreUISafeInsets` viewport coordinate system,
1230+
while this function uses the
1231+
`Enum.ScreenInsets|DeviceSafeInsets` viewport coordinate system. If you
1232+
would like to specify position in core UI coordinates, please use
11941233
`Class.Camera:ScreenPointToRay()`.
11951234
1196-
Also note that this function only works for the `Class.Workspace.CurrentCamera` camera.
1197-
Other cameras, such as those you create for a `Class.ViewportFrame`, have an initial
1198-
viewport size of `(1, 1)` and are only updated after you set them to
1199-
`Class.Workspace.CurrentCamera|CurrentCamera`. The mismatch in viewport size causes
1200-
the camera to return a ray with an incorrect `Datatype.Ray.Direction`.
1235+
Also note that this function only works for the `Class.Workspace.
1236+
CurrentCamera` camera.
1237+
Other cameras, such as those you create for a `Class.ViewportFrame`, have
1238+
an initial viewport size of `(1, 1)` and are only updated after you set
1239+
them to `Class.Workspace.CurrentCamera|CurrentCamera`. The mismatch in
1240+
viewport size causes the camera to return a ray with an incorrect
1241+
`Datatype.Ray.Direction`.
12011242
This function can be used in conjunction with the
12021243
`Class.Camera.ViewportSize` property to create a ray from the centre of
12031244
the screen, for example:
@@ -1223,14 +1264,16 @@ methods:
12231264
type: float
12241265
default:
12251266
summary: |
1226-
The position on the **X** axis, in pixels, of the viewport point at which
1227-
to originate the `Datatype.Ray`, in device safe area coordinates.
1267+
The position on the **X** axis, in pixels, of the viewport point at
1268+
which to originate the `Datatype.Ray`, in device safe area
1269+
coordinates.
12281270
- name: 'y'
12291271
type: float
12301272
default:
12311273
summary: |
1232-
The position on the **Y** axis, in pixels, of the viewport point at which
1233-
to originate the `Datatype.Ray`, in device safe area coordinates.
1274+
The position on the **Y** axis, in pixels, of the viewport point at
1275+
which to originate the `Datatype.Ray`, in device safe area
1276+
coordinates.
12341277
- name: depth
12351278
type: float
12361279
default: 0

0 commit comments

Comments
 (0)