2016-02-27 131 views
0

我想設置90萬世界的高度,但移相器似乎停止在13860:設置世界界限

game.world.setBounds(0, 0, 1400, 900000); 

是否有某種在PhaserJS限制範圍?

回答

2

我一直未能在documentationsource中找到任何提及的世界限制。

此外,狀態(TypeScript)中的以下代碼在直接請求時以及在相機調試信息中正確返回設置的世界寬度和高度。

module TestingProject { 
    export class WorldBounds extends Phaser.State { 
     init() { 
      this.game.world.setBounds(0, 0, 1400, 900000); 
     } 

     create() { 
      var fontStyle = { fill: '#fff' }; 

      // Returns 1400 
      var worldWidthText = this.game.add.text(50, 150, 
       "World width: " + this.game.world.bounds.width, fontStyle); 
      // Returns 900000 
      var worldHeightText = this.game.add.text(50, 200, 
       "World height: " + this.game.world.bounds.height, fontStyle); 
     } 

     render() { 
      // Returns bounds of x,y = 0,0 and w,h = 1400,900000 
      this.game.debug.cameraInfo(this.camera, 50, 50); 
     } 
    } 
} 
0

老實說,我找不到有關限制的任何文檔,似乎沒有一個。