云变量配置

This commit is contained in:
ChengYu 2023-10-10 21:51:14 +08:00
parent 80532795cd
commit 08461ab70e
2 changed files with 20 additions and 1 deletions

View File

@ -28,7 +28,7 @@
cloudData:{
enable: true, //是否开启云变量功能
id: "create", //默认云变量ID可使用window.scratch.setCloudId更换ID
api: "127.0.0.1:1234/api/websocket/scratch/cloudData" //云变量API地址
api: window.location.hostname + ":8081/api/websocket/scratch/cloudData" //云变量API地址
},
projectInfo: {//作品信息
projectName: "",
@ -168,6 +168,11 @@
},
//默认作品加载完毕
handleDefaultProjectLoaded:() => {
// let url = ''
// window.scratch.loadProject(url, () => {
// window.scratch.setCloudId('666')
// vm.runtime.start()
// })
},
//默认项目地址,不需要修请删除本配置项
defaultProjectURL: window.location.protocol+"//"+window.location.host + "/static/project.sb3",

View File

@ -17,6 +17,15 @@
<% } %>
<script>
window.scratchConfig = {
cloudData:{
enable: true,
id: 'create', //云变量ID
api: window.location.hostname + ":8081/api/websocket/scratch/cloudData" //云变量API地址
},
projectInfo: {//作品信息
authorUsername: "",
authorAvatar: './static/avatar.png',
},
stageArea:{
scale: window.innerWidth / 480, //自适应屏幕尺寸
width: 480,
@ -50,6 +59,11 @@
handleProjectLoaded:() => {
},
handleDefaultProjectLoaded:() => {
// let url = ''
// window.scratch.loadProject(url, () => {
// window.scratch.setCloudId('666')
// vm.runtime.start()
// })
},
//默认项目地址,不需要修请删除本配置项
defaultProjectURL: window.location.protocol+"//"+window.location.host + "/static/project.sb3",