Sprite scale on browser resize

Hey, Im having a few Sprites in my scene. All have sizeAttenuation = false, so all sprites stay the same size when zooming.
I noticed that when resizing the canvas vertically, everything in the scene is getting scaled down to fit in the camera, also the Sprites. Is there a way to keep my sprites the same size even when resizing down the canvas?

I read that Points (PointsMaterial) are scaled in pixel sizes, but same thing is happening. They are also scaled down when resizing the canvas?

Any help is appreaciated
Thanks

I can only think of two ways:

  • rescale the sprites to compensate the resize (this scales the scene, but keeps the sprites)
  • adjust the camera to compensate this resize (this keeps the scene and the sprites)

Here is a proof of concept of the camera way:

https://codepen.io/boytchev/full/GRPMaBL

image

1 Like