发了个帖子,结果消失了,又得重发了....没保存........2小时写的.........好气......
所以本贴挑重点讲
如何将Godot的HTML5导出项载入小程序
我们需要HBuilderX作为构建工具,并且需要下载对应平台的开发者工具并注册
首先下载HBuilderX标准版:
![](http://tiebapic.baidu.com/forum/w%3D580/sign=c10b1f8509178a82ce3c7fa8c602737f/64271f338744ebf859618176cef9d72a6059a72a.jpg?tbpicau=2024-09-19-05_ec772b9ea8d7a851d6ae8358645d78af)
下载uni-app编译插件:
![](http://tiebapic.baidu.com/forum/w%3D580/sign=34786360fcc4b7453494b71efffd1e78/0501e11fbe096b63c809bb191b338744ebf8ac2a.jpg?tbpicau=2024-09-19-05_d4c9bb8f5d4bcdb5f62568dd56384bf8)
![](http://tiebapic.baidu.com/forum/w%3D580/sign=ccaf69785d90f60304b09c4f0913b370/e4bf094c510fd9f99107b020322dd42a2834a42a.jpg?tbpicau=2024-09-19-05_57506748e65a686ef5dc1b0f83c8513a)
新建一个uni-app项目,使用默认模板:
![](http://tiebapic.baidu.com/forum/w%3D580/sign=abe9673c54a98226b8c12b2fba83b97a/b14e7863f6246b604c1e573dfcf81a4c510fa22a.jpg?tbpicau=2024-09-19-05_d59d9bd428ba989bf5c60e01a67148fa)
![](http://tiebapic.baidu.com/forum/w%3D580/sign=8c343bbda04543a9f51bfac42e168a7b/fd58ad096b63f624544ddc4a9044ebf81a4ca32a.jpg?tbpicau=2024-09-19-05_397004e8a1b69c6bc4ab72ba8b7b0eb4)
将Godot导出的HTML5文件全部移入刚才项目的static文件夹:
![](http://tiebapic.baidu.com/forum/w%3D580/sign=0184525fd8fc1e17fdbf8c397a91f67c/f96378600c338744a9d5ca35460fd9f9d72aa02a.jpg?tbpicau=2024-09-19-05_f52bf2c6521f20a7a9608900ee8b9abd)
![](http://tiebapic.baidu.com/forum/w%3D580/sign=8bd1ce6e9d82b9013dadc33b438ca97e/03749444ebf81a4c15220980c02a6059252da62a.jpg?tbpicau=2024-09-19-05_4f086339d883c022021ed163f9353805)
修改index.vue为以下代码:
![](http://tiebapic.baidu.com/forum/w%3D580/sign=f66893d09526cffc692abfba89004a7d/6424e5246b600c33c6693b810d4c510fd9f9a12a.jpg?tbpicau=2024-09-19-05_5521b9cd28efc6b24aabf77fa03d84e4)
![](http://tiebapic.baidu.com/forum/w%3D580/sign=5b3a5afbae014a90813e46b599763971/8803f8f81a4c510f9cd407537759252dd42aa52a.jpg?tbpicau=2024-09-19-05_baa2bb8ca75fe85dab49facab273a726)
然后编译并调试,你也可以直接选择运行到小程序模拟:
![](http://tiebapic.baidu.com/forum/w%3D580/sign=82af50730ed8bc3ec60806c2b28aa6c8/f4aab864034f78f019187fba6e310a55b3191c2b.jpg?tbpicau=2024-09-19-05_bdb4dd1917ab738b2dd9fc4b51ed4a7e)
![](http://tiebapic.baidu.com/forum/w%3D580/sign=2191bcf8970a19d8cb03840d03fb82c9/44bce8edab64034f95de274fb8c379310a551d2b.jpg?tbpicau=2024-09-19-05_83090285946fc13ca7ad9fe9c02b1866)
正常运行
![](http://tiebapic.baidu.com/forum/w%3D580/sign=6f24c9a1ab3eb13544c7b7b3961fa8cb/a423104f78f0f73640eda9481d55b319ebc4132b.jpg?tbpicau=2024-09-19-05_0a7141b3c7f2372de4b2b38efcd527b9)
最后发行:
![](http://tiebapic.baidu.com/forum/w%3D580/sign=e9f66c47a63533faf5b6932698d2fdca/0c086bf0f736afc3891fda2ca419ebc4b745122b.jpg?tbpicau=2024-09-19-05_8f3b10a7b0f3ec59743639908bf090c8)
记得去配置对应平台的实际的文件:
![](http://tiebapic.baidu.com/forum/w%3D580/sign=3d761cc67b81800a6ee58906813433d6/ab4858fbfbedab64ef61a889e036afc379311e2b.jpg?tbpicau=2024-09-19-05_9a1c50569e1be5bcdddb250017f7970a)