查看: 2206|回复: 1

[已经过期] 请教这个任务脚本的内容页面翻页问题

[复制链接]
梦石
0
星屑
809
在线时间
176 小时
注册时间
2017-1-15
回帖
50
发表于 2018-11-30 12:47:50 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 foot1982 于 2018-11-30 14:21 编辑

任务脚本在此
https://rpg.blue/thread-221055-1-1.html
这个任务脚本挺不错,简单实用,不过右边若是内容太多,就显示不完了

然后我看了喵呜喵5的阅读系统,那个翻页很顺畅很喜欢,想让任务脚本的内容页面也能像这样翻页- -我用这两个脚本拼了好久都不成功,可以翻页,但是显示不完字,我设了2页的字,但结果只能显示一页的内容,第二页的字就出不来了
下面这是阅读系统 By喵呜喵5
[pre lang="ruby"]=begin
===============================================================================
阅读系统 By喵呜喵5
===============================================================================
【说明】
将事件页中的滚动文字指令整个替换掉变成这个阅读系统……
使用方法很简单,选择事件指令中的滚动文字,之后在游戏中这个滚动文字就会以可以上下移动的对话框窗口显示出来
确定键和取消键可以结束阅读,上下键用于翻页,左右键用于快速翻页
因为没有加开关,所以基本上就别指望能再使用显示滚动文字功能了
……反正滚动文字的效果太坑爹了我也用不上
=end
module M5Read  
#==============================================================================
#  设定部分
#==============================================================================
  
  WIDTH = 60  
  #设置窗口的宽度,数字越大窗口越小
  
  HEIGHT = 60
  #设置窗口的高度,数字越大窗口越小
  
  SPEED = 3
  #设置文字滚动的速度,数字越大速度越快
  
  SPACE = 9
  #设置在文字开头和结尾部分的留空大小,数字越大留空越多
  
#==============================================================================
#  设定结束
#==============================================================================
end
#==============================================================================
#  脚本部分
#==============================================================================

class Window_ScrollText < Window_Base
  
  def initialize
    super(M5Read::WIDTH / 2, M5Read::HEIGHT / 3, winwidth, winheight)
    self.opacity = 255
    self.arrows_visible = true
    hide
  end
  
  def winwidth
    Graphics.width - M5Read::WIDTH
  end
  
  def winheight
    Graphics.height - M5Read::HEIGHT
  end  
  
  def update
    super
    if $game_message.scroll_mode
      update_message_up if Input.press?(:UP)
      update_message_down if Input.press?(:DOWN)
      15.times {update_message_up} if Input.press?(:LEFT)
      15.times {update_message_down} if Input.press?(:RIGHT)
      terminate_message if (Input.repeat?(:B) or Input.repeat?(:C))
      start_message if !@text && $game_message.has_text? && !Input.press?(:B)
    end
  end
  
  def start_message
    @text = $game_message.all_text
    self.oy = -M5Read::SPACE
    refresh
    show
  end
  
  def refresh
    reset_font_settings
    update_all_text_height
    create_contents
    draw_text_ex(4, 0, @text)
  end
  
  def update_all_text_height
    @all_text_height = 1
    convert_escape_characters(@text).each_line do |line|
      @all_text_height += calc_line_height(line, false)
    end
    reset_font_settings
  end
  
  def contents_height
    @all_text_height ? @all_text_height : super
  end
  
  def update_message_down
    if contents.height < winheight-standard_padding*2-M5Read::SPACE
      return
    end
    self.oy = [self.oy + scroll_speed,
    contents.height - winheight + standard_padding * 2 + M5Read::SPACE ].min
  end
  
  def update_message_up
    if contents.height < winheight-standard_padding*2-M5Read::SPACE
      return
    end   
    self.oy = [self.oy - scroll_speed,-M5Read::SPACE ].max
  end
  
  def scroll_speed   
    M5Read::SPEED   
  end
  
  def terminate_message
    @text = nil
    $game_message.clear
    hide
  end
end
#==============================================================================
#  脚本结束
#==============================================================================[/pre]
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部