设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2282|回复: 1
打印 上一主题 下一主题

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
572
在线时间
82 小时
注册时间
2020-6-14
帖子
23
跳转到指定楼层
1
发表于 2020-8-19 21:17:40 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

RT:LZ有一大段字需要输入,并且需要一个字一个字敲打出来的效果(后期会配上打字音效),最后效果大概如图(那种打出来不会消失的那种)
因为需要动态效果所以不能直接用图片
求解!

效果.jpg (103.75 KB, 下载次数: 21)

效果.jpg

Lv5.捕梦者

梦石
0
星屑
26449
在线时间
5317 小时
注册时间
2016-3-8
帖子
1657
2
发表于 2020-8-19 21:54:53 | 只看该作者
对话框显示行数扩展脚本与下方脚本搭配使用,应该就是你要的效果了
RUBY 代码复制
  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: [email protected]
  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.  
  25. class Window_Message < Window_Base
  26.  
  27.   DEFAULT_SE_FREQ = 5               #默认频率
  28.   DEFAULT_AUDIO_SOUND = "Cancel2"   #打字音效名
  29.   DEFAULT_AUDIO_VOLUME = 75         #默认音量
  30.   DEFAULT_AUDIO_PITCH = [75,125]    #默认音调范围[最小值,最大值]
  31.  
  32.   attr_accessor  :se
  33.   attr_accessor  :freq
  34.   attr_accessor  :volume
  35.   attr_accessor  :pitch
  36.  
  37.   alias mse_clear_instance_variables clear_instance_variables
  38.   def clear_instance_variables
  39.     mse_clear_instance_variables
  40.     @key_timer = 0
  41.     reset_se_variables
  42.   end
  43.   def reset_se_variables
  44.     @se = DEFAULT_AUDIO_SOUND
  45.     @volume = DEFAULT_AUDIO_VOLUME
  46.     @pitch = DEFAULT_AUDIO_PITCH
  47.     @freq = DEFAULT_SE_FREQ
  48.   end
  49.   def process_normal_character(c, pos)
  50.     super
  51.     if !$game_options.nil?
  52.       return wait_for_one_character unless $game_options.message_se
  53.     end
  54.     if @key_timer % @freq == 0
  55.       Audio.se_play("Audio/SE/" + @se, @volume, rand(@pitch[1]-@pitch[0]) + @pitch[0])
  56.     end
  57.     @key_timer += 1
  58.     wait_for_one_character
  59.   end
  60. end
  61.  
  62. class Scene_Map
  63.   attr_accessor  :message_window
  64. end
  65.  
  66. class Game_Interpreter
  67.   def message_set(string, value, array, freq = -1)
  68.     message_se(string)
  69.     message_volume(value)
  70.     message_pitch(array)
  71.     message_freq(freq) if freq >= 0
  72.   end
  73.   def message_freq(value)
  74.     SceneManager.scene.message_window.freq = value
  75.   end
  76.   def message_se(string)
  77.     SceneManager.scene.message_window.se = string
  78.   end
  79.   def message_pitch(array)
  80.     SceneManager.scene.message_window.pitch = array
  81.   end
  82.   def message_volume(value)
  83.     SceneManager.scene.message_window.volume = value
  84.   end
  85.   def message_reset
  86.     SceneManager.scene.message_window.reset_se_variables
  87.   end
  88. end

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-21 01:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表