How can I go about this? My strategy was this: I have the correct look on a device with pixel ratio 3, so I decided to use 3 as the base and then divide the pixel ratio of the current device by 3 and multiple by the local scale. Like this
initialScale * (window.devicePixelRatio/3);
It almosts looks right, but not quite. What am I missing? Thanks!
Hi Yaustar, I appreciate that you looked into this. The reason it has to be a fixed width is because if it isn’t, PlayCanvas messes with the number of lines, margin, etc. You can see on the video that you posted that on some screens there are 3 lines of text, on some there are 4, etc. This has to be the same across devices.
I didn’t know about the trick of setting different phones up there. Does the pixel ratio change as well when you do that?
Combine that with split anchors on the width, that should get you what you want?
If you change from samsung s8+ to Pixel5, you will notice that the arrangement of the letters changed. On the pixel5 the last line has almost the same width as the line before, but not on samsung s8+ T_T. I can see that this task is harder than I expected it to be T_T.
Hm, when I tried on the phones though it looks the same. Can you explain this to me? Why auto fit height? It’s the width that I want the same, this is confusing T_T.
It’s not working. I swear it worked once though, wtf.
It really doesn’t work Yaustar. I just thought it did. I tested your example project, and the margin is still different. Just start changing the width of the screen to make it smaller and you will see the text letters rearranging instead of everything scaling down to look the same…