【问题标题】:In Gamemaker Studio 2 how can I find out in code whether the platform is HTML5 or not?在 Gamemaker Studio 2 中,我如何在代码中找出平台是否为 HTML5?
【发布时间】:2017-12-31 13:05:59
【问题描述】:

我希望能够运行或不运行代码,具体取决于我为哪个平台构建。 一些代码应该只为 HTML5 平台运行。 如何在我的游戏制作者事件中确定正在运行的平台是否为 HTML5?

【问题讨论】:

    标签: game-maker game-maker-language game-maker-studio-2


    【解决方案1】:

    感谢:Charanor 找到了答案。 https://gamedev.stackexchange.com/questions/152719/in-gamemaker-studio-2-how-can-i-find-out-in-code-whether-the-platform-is-html5-o

    您可以使用 os_browser 常量检查游戏当前在哪个浏览器中运行。如果游戏不在浏览器中运行,则常量将为 browser_not_a_browser。因此,要检查它是否在浏览器中运行,只需执行以下操作:

    if os_browser != browser_not_a_browser {
         // Being run in a browser
    }
    

    【讨论】:

      猜你喜欢
      • 2021-12-02
      • 2021-11-18
      • 1970-01-01
      • 1970-01-01
      • 2021-09-21
      • 2021-10-09
      • 1970-01-01
      • 2019-08-31
      • 1970-01-01
      相关资源
      最近更新 更多