Skip to content

changes to devicePixelRatio in Unity, React Reloading.. #428

Discussion options

You must be logged in to vote

Hi there! I suggest not changing the device pixel ratio like this. Especially not with fractional numbers since the monitor cannot display half pixels anyway. I recommend keeping the pixel ratio in sync with the windows pixel ratio and add an option for the user to switch to a device pixel ratio of 1, for low end devices.

Read more: https://react-unity-webgl.dev/docs/api/canvas-device-pixel-ratio

Another way to change the render size is changing the internal canvas size using the Canvas' reference. This is not documented in the 9.x documentation yet, but it can be applied in the latest version as well.

Read more: https://react-unity-webgl.dev/docs/8.x.x/api/match-webgl-to-canvas-size

I ho…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@devilofdev
Comment options

Answer selected by jeffreylanters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants