微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

JavaScript中的this.load.setBaseURL

如何解决JavaScript中的this.load.setBaseURL

我正在尝试学习javascript和phaserjs,并在index.html中找到一行内容: this.load.setBaseURL('http://labs.phaser.io'); 有人知道setBaseURL的功能是什么? 谢谢

解决方法

documentation这样说,

If you want to append a URL before the path of any asset you can set this here.

Useful if allowing the asset base url to be configured outside of the game code.

Once a base URL is set it will affect every file loaded by the Loader from that point on. It does not change any file already being loaded. To reset it,call this method with no arguments.

因此,它将更改声明后要加载的资产/文件的基本路径。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。