Screen Space
While Nova renders in world-space by default, the ScreenSpace component can be used to render a Nova hierarchy in screen-space for a target camera.
This behavior is very similar to a Unity Canvas in the Screen Space - Camera
configuration.
Fill Mode
The ScreenSpace component will automatically adjust the position, size, and scale of its UIBlock to ensure it fills the camera's viewport. However, the exact way that the UIBlock's Size is adjusted for different screen sizes can be configured to best suit the content:
Fill Mode | Description |
---|---|
FixedWidth | The UIBlock's width is held constant at the Reference Resolution width while the height is adjusted to match the camera's aspect ratio. |
FixedHeight | The UIBlock's height is held constant at the Reference Resolution height while the width is adjusted to match the camera's aspect ratio. |
MatchCameraResolution | The UIBlock's width and height are set to the camera's pixel dimensions. For example, if the camera is rendering full-screen to a 1920x1080 output, the UIBlock's Size will be set to 1920x1080 as well. |
Manual | The Size and scale of the UIBlock is not modified. This may be useful if you wish to implement a custom resize behavior while still having the content only render to the TargetCamera. |
World Space
All UIBlocks, even those under a ScreenSpace component, are rendered in world-space using the Transforms on their respective GameObjects, similar to MeshRenderers (although Nova does not actually use any MeshRenderers). This means when you want to position, rotate, or scale an entire menu/panel/etc. built with Nova, simply position, rotate, or scale the Transform on its root UIBlock (or one of its ancestors).
Sizing and Scaling
Because UIBlocks are rendered in world space, the values assigned to the various UIBlock properties, such as Size, Position, Corner Radius, Border Width, and so on, correspond to standard world-space units – meaning an unscaled UIBlock with a width of 1
will be 1m
wide in the scene. What this often translates to in practice (depending on your desired final world-space size) is requiring very small values in certain situations, such as a Border Width of 0.01
to achieve a thin Border on a 1m
wide UIBlock2D.
For this reason, it can be convenient to construct Nova content at much larger sizes, allowing you to operate in larger units across all your Nova components and custom scripts, and then apply a small, uniform scale to the Transform on your content's root UIBlock. For example, most of the Nova Samples are built with a 1920 x 1080
reference size in mind and then have a scale of 0.001
applied to their UI root Transforms. Constructing content with larger units and scaling down the UI root, as opposed to leaving the root unscaled and using smaller world-space values, is not required and subject to user preference/scenario. The following table highlights some benefits and tradeoffs of both options:
Root Scale | Pros | Cons |
---|---|---|
Scaled down | More user-friendly adjustments (e.g. +/- 1 rather than +/- 0.001 ). Easier portability between Nova and other design tools because it's closer to working in "pixel" units. |
The size of your Nova content relative to other scene objects needs to be calculated. |
Unscaled | Size of Nova content relative to other objects in scene is easily determined. | Will likely require small decimals in many places and makes minor adjustments less user-friendly. |
Note
Once you have selected a size and scale to work in, you can easily modify the default values of UIBlocks to better match your scenario.
Warning
UIBlocks do not support non-uniform scaling. See Unity's Transform documentation for more about issues with non-uniform scaling.