Fix weather

This commit is contained in:
ckcz123 2021-08-10 20:10:44 +08:00
parent aa9f0fc978
commit a3cefb6e63
2 changed files with 9 additions and 1 deletions

View File

@ -527,6 +527,14 @@ core.registerWeather('blood', function (level) {
样板的云`cloud`和雾`fog`均由多个图片叠加移动实现;如果你想实现类似效果,可直接使用`core.control.__animateFrame_weather_image`作为`frameFunc`,详见样板的云雾实现。 样板的云`cloud`和雾`fog`均由多个图片叠加移动实现;如果你想实现类似效果,可直接使用`core.control.__animateFrame_weather_image`作为`frameFunc`,详见样板的云雾实现。
另外注意的是,注册的天气无法在事件编辑器的下拉框中选择;你可以选择脚本调用`core.setWeather`,或者修改`_server/MotaAction.g4`中的`Weather_List`:
```js
Weather_List
: '无'|'雨'|'雪'|'晴'|'雾'|'云'
/*Weather_List ['null','rain','snow','sun','fog','cloud']*/;
```
### registerSystemEvent ### registerSystemEvent
``` ```

View File

@ -2466,7 +2466,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
}, },
"registerWeather": { "registerWeather": {
"!doc": "注册一个天气<br/>name: 要注册的天气名<br/>initFunc: 当切换到此天气时的初始化接受level天气等级为参数可用于创建多个节点如初始化雪花<br/>frameFunc: 每帧的天气效果变化可接受timestamp从页面加载完毕到当前所经过的时间和level天气等级作为参数<br/>天气应当仅在weather层进行绘制推荐使用core.animateFrame.weather.nodes用于节点信息。", "!doc": "注册一个天气<br/>name: 要注册的天气名<br/>initFunc: 当切换到此天气时的初始化接受level天气等级为参数可用于创建多个节点如初始化雪花<br/>frameFunc: 每帧的天气效果变化可接受timestamp从页面加载完毕到当前所经过的时间和level天气等级作为参数<br/>天气应当仅在weather层进行绘制推荐使用core.animateFrame.weather.nodes用于节点信息。",
"!type": "fn(name: string, initFunc: fn(level: number), frameFunc?: fn( timestamp: number, level: number))" "!type": "fn(name: string, initFunc: fn(level: number), frameFunc?: fn(timestamp: number, level: number))"
}, },
"stopReplay": { "stopReplay": {
"!doc": "停止播放", "!doc": "停止播放",