How can I set the DPI in game view?
I’d like game view to match both resolution and DPI so that it reflects the devices I’m testing with, rather than having to do separate builds for each device with different UI Toolkit panel settings reference DPI.
If you mean scaling and pixels within UI, that has nothing to do with device DPI.
Here are some notes on UI Anchoring, Scaling, CanvasScaler, etc:
It can be very fiddly but it is super-powerful once you reach comfort with the UI.
Building upon Praetor’s great post above, let me suggest this approach:
make a quick first draft of your UI.
in the Unity game window change the shape / dimensions of your Game window (you can even make your own resolutions)
see what happens to your UI in this new shape window
iterate and fix your anchors and scalings and whatnot
Make sure you do not overlook the Canvas Scaler settings. Personally I (almost) …
That seems excessive… What is the text of the actual complaint from them?
Make something like this with a fixed aspect ratio (in this case 2:1, maybe you need 3:1 or whatever suits your buttons), and ALL your buttons anchored inside it to never move within that box:
[7337383--891847--fixed_aspect_ratio_box.png]
then anchor that fixed against the bottom center (red dot below).
On the ipad it looks like:
[7337383--891850--ipad.png]
on the iPhone it looks like:
[7337383--891853--iphonex.pn…
Otherwise, not sure how you would set the DPI…
You can read device DPI from here:
vannus
June 1, 2022, 12:21am
3
Thanks for the links, but I think both of them are for nGUI and not relevant for UI Toolkit.
I’m looking to set the DPI for the game view presets, rather than in my game.