Hello all!
On PC - game looks ok, on all screen.
             
            
              1 Like 
            
                
            
           
          
            
              
                samme  
              
                  
                    July 30, 2022,  5:45pm
                   
                  2 
               
             
            
              
Does it scale to fit if you resize the window?
             
            
              1 Like 
            
            
           
          
            
            
              Yes, on PC if i resize, the game size is responsive
             
            
              
            
           
          
            
              
                samme  
              
                  
                    August 1, 2022,  4:02pm
                   
                  4 
               
             
            
              Do you have
<meta name="viewport" content="width=device-width, initial-scale=1">
?
             
            
              
            
           
          
            
            
              Yes, i use this property/
             
            
              
            
           
          
            
            
              
 samme:
 
What’s in the HTML?
 
 
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Game</title>
	<style>
		body {
			padding: 0;
			margin: 0;
			background-color: #000;
		}
	</style>
</head>
Tag <body> has only scripts.
             
            
              
            
           
          
            
              
                samme  
              
                  
                    August 2, 2022,  5:07pm
                   
                  9 
               
             
            
              This looks right for scale mode FIT.
What do you want it to look like?
             
            
              
            
           
          
            
            
              It would be OK if background get all screen size on mobile, like css property backround-size: cover;
             
            
              
            
           
          
            
            
              It exists:
  object-fit: cover;
oh but im not sure it’s for img and video inittial
             
            
              
            
           
          
            
            
              I know this property in css - it uses for video and images, but how this use in Phaser?
             
            
              
            
           
          
          
            
            
              Thank you!
             
            
              
            
           
          
            
            
              In line 23, the number 400 indicates the minimum height to which the camera zooms.
             
            
              
            
           
          
            
            
              Qugurun, i tried using your code and this is a great solution if we use simple background (just color) on the game. But if we use some image - this way not save ratio our background:
Original ratio
 
not original  - image is distortion
 
 
I changed your code a little - remove upgrade function for bacground and set scale = 5 for background
let bg = this.add.image(window.innerWidth / 2, window.innerHeight / 2, 'bg').setScale(5)
		// bg.update = function () {
		// 	this.displayWidth = app.width
		// 	this.displayHeight = app.height
		// }
result:
And this is the result I was looking for!
             
            
              2 Likes 
            
            
           
          
            
            
              I am glad that my decision helped you.
        let bg = this.add.image(window.innerWidth / 2, window.innerHeight / 2, 'bg')
        bg.orgWidth = bg.displayWidth
        bg.orgHeight = bg.displayHeight
        bg.update = function () {
            if (app.width * this.orgHeight/this.orgWidth < app.height){
                this.displayWidth = app.height * this.orgWidth/this.orgHeight
                this.displayHeight = app.height
            }else{
                this.displayWidth = app.width
                this.displayHeight = app.width * this.orgHeight/this.orgWidth
            }
        }
In the horizontal view, it will always adjust proportionally in width, if the portrait view is proportional in height.
             
            
              1 Like 
            
            
           
          
            
            
              Cool, it’s more correct than using Scaling.
             
            
              
            
           
          
            
              
                Qugurun  
              
                  
                    February 12, 2024,  5:02pm
                   
                  20 
               
             
            
              https://qugurun.github.io/phaser3/adaptive/index.html 
  
  
    
    
      
              type: Phaser.AUTO,              // Режим рендера
 
              antialias: true,                // Сглаживание
 
              disableContextMenu: true,       // Отключить меню по правому клику
 
              autoMobilePipeline: true,       // Оптимизация для мобильных устрйств
 
              autoRound: true,                // Размеры холста в целых числах
 
              scene: SC_MAIN                  // Сцена
 
          }
 
          
 
          let GAME = new Phaser.Game(config);
 
          
 
          GAME.onResize = function (){
 
              let size;
 
          
 
              this.scale.resize(window.innerWidth, window.innerHeight);
 
          	this.scale.refresh();
 
             
 
              if (config.orientation == "landscape") {
 
                  size = config.virtualWidth
 
          
 
              }else if (config.orientation == "portrait"){
 
                  size = config.virtualHeight
 
       
     
  
    
    
  
  
 
I came up with a new way, and I think it’s much more successful and correct than what I did with the camera.