79170104

Date: 2024-11-08 12:57:23
Score: 1
Natty:
Report link

if you mean relative to the screen, you should use the code below

this.iw = window.innerWidth;
this.ih = window.innerHeight;

then use this code

      let tree = this.physics.add
          .sprite(500*this.iw, 300*this.ih, "tree")
          .setScale(0.5*(this.iw/this.ih));
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Coco