Hi all,
I've been struggling with this problem for a little while. I'd like for one of my sprites to cover the whole screen, whatever the size or ratio. Currently the game doesn't have a ratio configured to leave it responsive and it seems to work pretty well for my purpose.
To scale the sprite to the camera size, I found a first hurdle: I couldn't get the pixel ratio of a world unit (the camera has an orthographic scale of 20, which as far as I understand means that its height is worth 20 whatever the actual screen height). I added a couple of methods to get the width/height of the screen/camera by using something like `this.actor.gameInstance.threeRenderer.domElement.clientWidth * this.viewport.width` inside the Camera.
Now I'm able to do camera width/sprite width (taken from the grid size) which gives me a scaling factor which should stretch/shrink the sprite to match the size of the camera. However, it seems like there's a variable in there I'm not accounting since it's always too big or too small!
The last values in the console are screen width in px, sprite width in px, scaling factor to make it fit in the window, screen width in world unit, screen height in world unit.
What am I missing/doing wrong?