本帖最后由 元一一 于 2020-8-19 21:19 编辑 RT:LZ有一大段字需要输入,并且需要一个字一个字敲打出来的效果(后期会配上打字音效),最后效果大概如图(那种打出来不会消失的那种) 因为需要动态效果所以不能直 ...
#简单文章打字音效 v1.0.1#----------##功能: 让文章显示时播放不同音调的打字音效. 很棒!##使用方法: 即插即用, 下面是可用脚本:## message_freq(数值) - 改变频率# message_se("文件名") - 改变打字音效# message_volume(数值) - 改变音量# message_pitch([最小值,最大值]) - 改变音调范围# message_set(文件名,音量,音调) - 一次设定文件名音量和音调# message_set(文件名,音量,音调,频率) - 同上,但是增加了频率##----------##-- Script by: V.M of D.T##- Questions or comments can be:# posted on the thread for the script# given by email: [email protected]# provided on facebook: [url]http://www.facebook.com/DaimoniousTailsGames[/url]# All my other scripts and projects can be found here: [url]http://daimonioustails.weebly.com/[/url]##- Free to use in any project with credit given, donations always welcome! class Window_Message < Window_Base DEFAULT_SE_FREQ = 5 #默认频率 DEFAULT_AUDIO_SOUND = "Cancel2" #打字音效名 DEFAULT_AUDIO_VOLUME = 75 #默认音量 DEFAULT_AUDIO_PITCH = [75,125] #默认音调范围[最小值,最大值] attr_accessor :se attr_accessor :freq attr_accessor :volume attr_accessor :pitch alias mse_clear_instance_variables clear_instance_variables def clear_instance_variables mse_clear_instance_variables @key_timer = 0 reset_se_variables end def reset_se_variables @se = DEFAULT_AUDIO_SOUND @volume = DEFAULT_AUDIO_VOLUME @pitch = DEFAULT_AUDIO_PITCH @freq = DEFAULT_SE_FREQ end def process_normal_character(c, pos) super if !$game_options.nil? return wait_for_one_character unless $game_options.message_se end if @key_timer % @freq == 0 Audio.se_play("Audio/SE/" + @se, @volume, rand(@pitch[1]-@pitch[0]) + @pitch[0]) end @key_timer += 1 wait_for_one_character endend class Scene_Map attr_accessor :message_windowend class Game_Interpreter def message_set(string, value, array, freq = -1) message_se(string) message_volume(value) message_pitch(array) message_freq(freq) if freq >= 0 end def message_freq(value) SceneManager.scene.message_window.freq = value end def message_se(string) SceneManager.scene.message_window.se = string end def message_pitch(array) SceneManager.scene.message_window.pitch = array end def message_volume(value) SceneManager.scene.message_window.volume = value end def message_reset SceneManager.scene.message_window.reset_se_variables endend
#简单文章打字音效 v1.0.1 #----------# #功能: 让文章显示时播放不同音调的打字音效. 很棒! # #使用方法: 即插即用, 下面是可用脚本: # # message_freq(数值) - 改变频率 # message_se("文件名") - 改变打字音效 # message_volume(数值) - 改变音量 # message_pitch([最小值,最大值]) - 改变音调范围 # message_set(文件名,音量,音调) - 一次设定文件名音量和音调 # message_set(文件名,音量,音调,频率) - 同上,但是增加了频率 # #----------# #-- Script by: V.M of D.T # #- Questions or comments can be: # posted on the thread for the script # given by email: [email protected] # provided on facebook: [url]http://www.facebook.com/DaimoniousTailsGames[/url] # All my other scripts and projects can be found here: [url]http://daimonioustails.weebly.com/[/url] # #- Free to use in any project with credit given, donations always welcome! class Window_Message < Window_Base DEFAULT_SE_FREQ = 5 #默认频率 DEFAULT_AUDIO_SOUND = "Cancel2" #打字音效名 DEFAULT_AUDIO_VOLUME = 75 #默认音量 DEFAULT_AUDIO_PITCH = [75,125] #默认音调范围[最小值,最大值] attr_accessor :se attr_accessor :freq attr_accessor :volume attr_accessor :pitch alias mse_clear_instance_variables clear_instance_variables def clear_instance_variables mse_clear_instance_variables @key_timer = 0 reset_se_variables end def reset_se_variables @se = DEFAULT_AUDIO_SOUND @volume = DEFAULT_AUDIO_VOLUME @pitch = DEFAULT_AUDIO_PITCH @freq = DEFAULT_SE_FREQ end def process_normal_character(c, pos) super if !$game_options.nil? return wait_for_one_character unless $game_options.message_se end if @key_timer % @freq == 0 Audio.se_play("Audio/SE/" + @se, @volume, rand(@pitch[1]-@pitch[0]) + @pitch[0]) end @key_timer += 1 wait_for_one_character end end class Scene_Map attr_accessor :message_window end class Game_Interpreter def message_set(string, value, array, freq = -1) message_se(string) message_volume(value) message_pitch(array) message_freq(freq) if freq >= 0 end def message_freq(value) SceneManager.scene.message_window.freq = value end def message_se(string) SceneManager.scene.message_window.se = string end def message_pitch(array) SceneManager.scene.message_window.pitch = array end def message_volume(value) SceneManager.scene.message_window.volume = value end def message_reset SceneManager.scene.message_window.reset_se_variables end end
查看全部评分
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2025-7-22 04:05
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.