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

相关推荐
Dxy12393102162 小时前
Python PDFplumber详解:从入门到精通的PDF处理指南
开发语言·python·pdf
EutoCool3 小时前
Qt:布局管理器Layout
开发语言·c++·windows·嵌入式硬件·qt·前端框架
Cyanto3 小时前
Spring注解IoC与JUnit整合实战
java·开发语言·spring·mybatis
写不出来就跑路3 小时前
WebClient与HTTPInterface远程调用对比
java·开发语言·后端·spring·springboot
悠哉清闲4 小时前
C++ MediaCodec H264解码
开发语言·c++
张人玉4 小时前
c#中Random类、DateTime类、String类
开发语言·c#
Jinkxs4 小时前
JavaScript性能优化实战技术
开发语言·javascript·性能优化
ydm_ymz5 小时前
C语言初阶4-数组
c语言·开发语言
Maybyy5 小时前
力扣242.有效的字母异位词
java·javascript·leetcode
presenttttt5 小时前
用Python和OpenCV从零搭建一个完整的双目视觉系统(六 最终篇)
开发语言·python·opencv·计算机视觉