赞 | 17 |
VIP | 0 |
好人卡 | 0 |
积分 | 34 |
经验 | 0 |
最后登录 | 2025-4-1 |
在线时间 | 153 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 3421
- 在线时间
- 153 小时
- 注册时间
- 2018-1-22
- 帖子
- 146
|
本帖最后由 526396987 于 2025-3-16 06:52 编辑
一般是在create()中赋值一个坐标偏移,然后在update()中每帧更新,直到偏移为0
用主选单的角色信息窗口举一个例子,你可以复制保存为一个新的js文件,放在js/plugins/目录下,并在插件管理器中开启
- var _Temp_Scene_Menu_createStatusWindow = Scene_Menu.prototype.createStatusWindow;
- Scene_Menu.prototype.createStatusWindow = function() {
- _Temp_Scene_Menu_createStatusWindow.call(this);
-
- this._statusWindow.realX = this._statusWindow.x;
- this._statusWindow.x += 100; // x轴偏移量
- };
- var _Temp_Scene_Menu_update = Scene_Menu.prototype.update;
- Scene_Menu.prototype.update = function() {
- _Temp_Scene_Menu_update.call(this);
-
- if (this._statusWindow.x > this._statusWindow.realX) {
- this._statusWindow.x -= 5; // 每帧更新5个单位(速度)
- if (this._statusWindow.x <= this._statusWindow.realX) this._statusWindow.x = this._statusWindow.realX; // 当存在小数时 修正浮点精度问题
- };
- };
复制代码 |
评分
-
查看全部评分
|