View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002191 | NoesisGUI | Unity3D | public | 2021-11-16 21:57 | 2021-11-17 21:41 |
Reporter | rachelle | Assigned To | sfernandez | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Product Version | 3.1 | ||||
Target Version | 3.1.2 | Fixed in Version | 3.1.2 | ||
Summary | 0002191: Scaling broken on 4K monitors post-3.1.0 upgrade | ||||
Description | Our top-level UI is controlled by a file called HUD.xaml. In this file, we bind the top-most UI element's width and height to the screen width and height, like so: <Grid x:Name="LayoutRoot" Width="{Binding Layout.ScreenWidth}" Height="{Binding Layout.ScreenHeight}" RenderTransformOrigin="0.5,0.5"> The default HorizontalAlignment and VerticalAlignment -- Stretch -- is set for this the LayoutRoot element. In Unity, we bind UnityEngine.Screen width and height to the driving data model as follows: layout.ScreenWidth = Screen.width; layout.ScreenHeight = Screen.height; We are not using Viewboxes. Prior to upgrading to Noesis 3.1.0, the above bindings were sufficient to properly scale our UI and fit it to the screen regardless of monitor size. Post-upgrade, things are not rendering properly on 3840 x 2160 monitors (but are rendering fine on smaller screens). Specifically, the UI doesn't appear to be stretching properly. We only see the top left quarter or so of our main HUD, with the bottom left, bottom right, and top right cut off. This makes the game unplayable and is preventing us from merging our Noesis 3.1.0 upgrade into our build. | ||||
Tags | No tags attached. | ||||
Platform | Any | ||||
Hi, In 3.1 we incorporated support for display DPI scale in the View. This means that if your display has the scale set to 150%, the view will scale the UI by 1.5 (this is set when creating the view in the NoesisView component: _uiView.SetScale(Screen.dpi > 0.0f ? Screen.dpi / 96.0f : 1.0f)). If you are not using Viewboxes, how is the UI scaled? are you using a LayoutTransform with a ScaleTransform instead? Anyway, if you don't set the Width/Height of the LayoutRoot, as its alignment is set to Stretch it will automatically fill the entire screen size, why do you need to explicitly set those properties to Screen.width/height? |
|
Thank you, removing bindings to width and height resolved this. And yes, we are using a LayoutTransform with a ScaleTransform instead -- we apply this to each of the 9 segments of a nine slice on our main HUD, as well as any floating/overlay elements throughout the UI. | |
Thanks for the update, closing this. | |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-11-16 21:57 | rachelle | New Issue | |
2021-11-17 11:30 | sfernandez | Assigned To | => sfernandez |
2021-11-17 11:30 | sfernandez | Status | new => assigned |
2021-11-17 11:30 | sfernandez | Target Version | => 3.1.2 |
2021-11-17 18:48 | sfernandez | Status | assigned => feedback |
2021-11-17 18:48 | sfernandez | Note Added: 0007582 | |
2021-11-17 20:39 | rachelle | Note Added: 0007583 | |
2021-11-17 20:39 | rachelle | Status | feedback => assigned |
2021-11-17 21:41 | sfernandez | Status | assigned => resolved |
2021-11-17 21:41 | sfernandez | Resolution | open => no change required |
2021-11-17 21:41 | sfernandez | Fixed in Version | => 3.1.2 |
2021-11-17 21:41 | sfernandez | Note Added: 0007584 |