【问题标题】:Debug object is undefined调试对象未定义
【发布时间】:2021-11-15 09:18:22
【问题描述】:

我查看了一堆不同的人民代码示例,他们使用的代码如下:

this.game.debug

我大概有 20 种组合,例如

this.game.debug
this.scene.debug, 
this.scene.game.debug

等等..但找不到这个调试,谁能指导我在哪里找到这个调试对象?

【问题讨论】:

  • 您对物理调试有疑问吗? labs.phaser.io/…
  • 效果很好,谢谢
  • 乐于助人 ;)

标签: phaser-framework


【解决方案1】:

Phaser 3 附带物理调试器,可通过配置启用。

var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    parent: 'phaser-example',
    physics: {
        default: 'arcade',
        arcade: {
            debug: true,
            gravity: { y: 200 }
        }
    },
    scene: {
        preload: preload,
        create: create
    }
};

var game = new Phaser.Game(config);

Here 一个工作示例,它为您提供如下内容:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-04
    • 2016-10-01
    • 2020-03-16
    • 1970-01-01
    • 2021-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多