RPGMZ游戏引擎 如何手动控制文字显示速度

直接上代码

复制代码
const _Window_Base_prototype_initialize = Window_Base.prototype.initialize;
	Window_Base.prototype.initialize = function(rect) {
		_Window_Base_prototype_initialize.call(this, rect);
		this.文字速度缓冲 = 0;
	};

this.文字速度缓冲 = 0; 进行缓冲

javascript 复制代码
Window_Base.prototype.processCharacter = function(textState) {
		this.文字速度缓冲 = this.文字速度缓冲 +0.1;
		if(this.文字速度缓冲>0.3){
			this.文字速度缓冲 = 0;
			const c = textState.text[textState.index++];
		
            if (c.charCodeAt(0) < 0x20) {
                this.flushTextState(textState);
                this.processControlCharacter(textState, c);
            } else {
                textState.buffer += c;
            }
		}
        
    };

this.文字速度缓冲 > 0.3 处理字符 速度可调整

这种方法适合不会写剧本的人使用 文字慢速显示 消耗玩家阅读时间 这样就可以弥补 剧情少的问题了

结尾总结

请Project1论坛的小圈子 离开

相关推荐
Dream achiever3 分钟前
11.WPF 的命令处理事件--参数介绍
开发语言·c#·wpf
_bong13 分钟前
python语言中的常用容器(集合)
开发语言·python
让时光到此为止。22 分钟前
vue的首屏优化是怎么做的
前端·javascript·vue.js
布伦鸽29 分钟前
C# WPF DataGrid 数据绑定时的单元格编辑类型模板
开发语言·c#·wpf
tqs_1234536 分钟前
分sheet写入excel
开发语言·python·算法
Roc-xb37 分钟前
解决Compile Run插件运行c/c++中文乱码问题
c语言·开发语言·c++
0wioiw037 分钟前
Esp32基础(①②大模型控制)
开发语言·python
San3043 分钟前
JavaScript 流程控制与数组操作全解析:从条件判断到数据高效处理
javascript·面试·代码规范
eqwaak044 分钟前
Pillow高级实战案例:图像处理的进阶应用
开发语言·python·科技·语言模型·pillow
dengzhenyue1 小时前
矩形碰撞检测
开发语言·前端·javascript