Javascript 在Phaser JS中设置世界边界

Javascript 在Phaser JS中设置世界边界,javascript,phaser-framework,Javascript,Phaser Framework,我试图将世界高度设定为900000,但Phaser似乎停止在13860: game.world.setBounds(0, 0, 1400, 900000); PhaserJS中的边界是否存在某种限制?我在or中找不到任何关于世界限制的提及 此外,当直接请求时,状态类型脚本中的以下代码正确返回设置的世界宽度和高度,以及摄影机调试信息中的设置 module TestingProject { export class WorldBounds extends Phaser.State {

我试图将世界高度设定为900000,但Phaser似乎停止在13860:

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

PhaserJS中的边界是否存在某种限制?

我在or中找不到任何关于世界限制的提及

此外,当直接请求时,状态类型脚本中的以下代码正确返回设置的世界宽度和高度,以及摄影机调试信息中的设置

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);
        }
    }
}

我在手术室里找不到任何关于世界极限的提及

此外,当直接请求时,状态类型脚本中的以下代码正确返回设置的世界宽度和高度,以及摄影机调试信息中的设置

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);
        }
    }
}

老实说,我找不到任何关于边界限制的文档,似乎没有。

老实说,我找不到任何关于边界限制的文档,似乎没有。

在我开始编写游戏时偶然发现了这个问题。使用比画布宽度和高度更宽、更高的瓷砖贴图。我正在使用Phaser 3,解决方案很简单

this.physics.world.setBounds 0,0,全宽,全高

我也在搜索它,我在Phaser.Physics.Arcade duh中发现了边界对象和setBounds函数,当然它可能在物理学中


无论如何,希望它能有所帮助。

在我开始编写游戏时,偶然发现了这个问题。使用比画布宽度和高度更宽、更高的瓷砖贴图。我正在使用Phaser 3,解决方案很简单

this.physics.world.setBounds 0,0,全宽,全高

我也在搜索它,我在Phaser.Physics.Arcade duh中发现了边界对象和setBounds函数,当然它可能在物理学中

不管怎样,希望能有帮助