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

相关推荐
598866753@qq.com6 小时前
Codex与Unity
unity·游戏引擎
admin and root6 小时前
「AI安全篇」实战AntiDebug自动化JS逆向加解密MCP
javascript·人工智能·网络安全·自动化·漏洞挖掘·cnvd·src赏金
落魄实习生6 小时前
Agent Scope Java 2.x 系列【7】工具使用
java·开发语言·ai
淡海水7 小时前
01-03-认知篇-C#内存模型深度解析
unity·c#·游戏引擎·.net·gc
茉莉玫瑰花茶7 小时前
GO [ 方法 ]
开发语言·后端·golang
狗凯之家源码网7 小时前
微博图床 PHP 系统搭建与实战应用指南
android·开发语言·php
wengad8 小时前
从 wangEditor 迁到 wangEditor-next
前端·javascript·vue.js
乌暮9 小时前
深入理解 Java 泛型:把「万能盒子」用对、用稳
java·开发语言·后端·学习
行者-全栈开发9 小时前
【前端/JS框架】CVE-2026-3854:GitHub Enterprise Server X-Stat注入XSS漏洞深度剖析与紧急修复指南
前端·javascript·github
2601_962218619 小时前
C语言中三种库的编译和使用方法
开发语言·c++