查看: 2885|回复: 1

[已经解决] 怎么在页面上做出一个字一个字敲打出来的效果

[复制链接]
梦石
0
星屑
620
在线时间
87 小时
注册时间
2020-6-14
回帖
14
发表于 2020-8-19 21:17:40 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 元一一 于 2020-8-19 21:19 编辑

RT:LZ有一大段字需要输入,并且需要一个字一个字敲打出来的效果(后期会配上打字音效),最后效果大概如图(那种打出来不会消失的那种)
因为需要动态效果所以不能直接用图片
求解!
效果.jpg
梦石
0
星屑
30103
在线时间
5741 小时
注册时间
2016-3-8
回帖
1662
发表于 2020-8-19 21:54:53 | 显示全部楼层
对话框显示行数扩展脚本与下方脚本搭配使用,应该就是你要的效果了
  1. #简单文章打字音效 v1.0.1
  2. #----------#
  3. #功能: 让文章显示时播放不同音调的打字音效. 很棒!
  4. #
  5. #使用方法:    即插即用, 下面是可用脚本:
  6. #
  7. #           message_freq(数值)       - 改变频率
  8. #           message_se("文件名")     - 改变打字音效
  9. #           message_volume(数值)     - 改变音量
  10. #           message_pitch([最小值,最大值]) - 改变音调范围
  11. #           message_set(文件名,音量,音调) - 一次设定文件名音量和音调
  12. #           message_set(文件名,音量,音调,频率) - 同上,但是增加了频率
  13. #
  14. #----------#
  15. #-- Script by: V.M of D.T
  16. #
  17. #- Questions or comments can be:
  18. #    posted on the thread for the script
  19. #    given by email: sumptuaryspade@live.ca
  20. #    provided on facebook: [url]http://www.facebook.com/DaimoniousTailsGames[/url]
  21. #   All my other scripts and projects can be found here: [url]http://daimonioustails.weebly.com/[/url]
  22. #
  23. #- Free to use in any project with credit given, donations always welcome!

  24. class Window_Message < Window_Base

  25.   DEFAULT_SE_FREQ = 5               #默认频率
  26.   DEFAULT_AUDIO_SOUND = "Cancel2"   #打字音效名
  27.   DEFAULT_AUDIO_VOLUME = 75         #默认音量
  28.   DEFAULT_AUDIO_PITCH = [75,125]    #默认音调范围[最小值,最大值]

  29.   attr_accessor  :se
  30.   attr_accessor  :freq
  31.   attr_accessor  :volume
  32.   attr_accessor  :pitch

  33.   alias mse_clear_instance_variables clear_instance_variables
  34.   def clear_instance_variables
  35.     mse_clear_instance_variables
  36.     @key_timer = 0
  37.     reset_se_variables
  38.   end
  39.   def reset_se_variables
  40.     @se = DEFAULT_AUDIO_SOUND
  41.     @volume = DEFAULT_AUDIO_VOLUME
  42.     @pitch = DEFAULT_AUDIO_PITCH
  43.     @freq = DEFAULT_SE_FREQ
  44.   end
  45.   def process_normal_character(c, pos)
  46.     super
  47.     if !$game_options.nil?
  48.       return wait_for_one_character unless $game_options.message_se
  49.     end
  50.     if @key_timer % @freq == 0
  51.       Audio.se_play("Audio/SE/" + @se, @volume, rand(@pitch[1]-@pitch[0]) + @pitch[0])
  52.     end
  53.     @key_timer += 1
  54.     wait_for_one_character
  55.   end
  56. end

  57. class Scene_Map
  58.   attr_accessor  :message_window
  59. end

  60. class Game_Interpreter
  61.   def message_set(string, value, array, freq = -1)
  62.     message_se(string)
  63.     message_volume(value)
  64.     message_pitch(array)
  65.     message_freq(freq) if freq >= 0
  66.   end
  67.   def message_freq(value)
  68.     SceneManager.scene.message_window.freq = value
  69.   end
  70.   def message_se(string)
  71.     SceneManager.scene.message_window.se = string
  72.   end
  73.   def message_pitch(array)
  74.     SceneManager.scene.message_window.pitch = array
  75.   end
  76.   def message_volume(value)
  77.     SceneManager.scene.message_window.volume = value
  78.   end
  79.   def message_reset
  80.     SceneManager.scene.message_window.reset_se_variables
  81.   end
  82. end
复制代码

评分

参与人数 1赞 +1 收起 理由
元一一 + 1 Thanks♪(・ω・)ノ

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部