查看: 2819|回复: 1

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

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

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

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

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

RT:LZ有一大段字需要输入,并且需要一个字一个字敲打出来的效果(后期会配上打字音效),最后效果大概如图(那种打出来不会消失的那种)
因为需要动态效果所以不能直接用图片
求解!
效果.jpg
梦石
0
星屑
29901
在线时间
5734 小时
注册时间
2016-3-8
回帖
1653
发表于 2020-8-19 21:54:53 | 显示全部楼层
对话框显示行数扩展脚本与下方脚本搭配使用,应该就是你要的效果了
[pre lang="ruby"]#简单文章打字音效 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: sumptuaryspade@live.ca
#    provided on facebook: http://www.facebook.com/DaimoniousTailsGames
#   All my other scripts and projects can be found here: http://daimonioustails.weebly.com/
#
#- 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[/pre]

评分

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

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部