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论坛的小圈子 离开

相关推荐
君莫笑几人回4 分钟前
关于记录一下“bug”,在做图片上传的时候出现的小问题
java·开发语言·spring boot
rockmelodies30 分钟前
RSA 解密逻辑
开发语言·python
澡点睡觉1 小时前
golang的包和闭包
开发语言·后端·golang
Dxy12393102162 小时前
python创建一个excel文件
开发语言·python·excel
安心不心安2 小时前
React ahooks——副作用类hooks之useThrottleFn
前端·javascript·react.js
朝朝又沐沐2 小时前
算法竞赛阶段二-数据结构(40)数据结构栈的STL
开发语言·数据结构·c++·算法
秋田君2 小时前
Vue3 + WebSocket网页接入弹窗客服功能的完整实现
前端·javascript·websocket·网络协议·学习
比特森林探险记2 小时前
Go语言常用的设计模式
开发语言·设计模式·golang
浪里行舟2 小时前
一网打尽 Promise 组合技:race vs any, all vs allSettled,再也不迷糊!
前端·javascript·vue.js