查看: 2245|回复: 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
  1. =begin
  2. ===============================================================================
  3. 阅读系统 By喵呜喵5
  4. ===============================================================================
  5. 【说明】
  6. 将事件页中的滚动文字指令整个替换掉变成这个阅读系统……
  7. 使用方法很简单,选择事件指令中的滚动文字,之后在游戏中这个滚动文字就会以可以上下移动的对话框窗口显示出来
  8. 确定键和取消键可以结束阅读,上下键用于翻页,左右键用于快速翻页
  9. 因为没有加开关,所以基本上就别指望能再使用显示滚动文字功能了
  10. ……反正滚动文字的效果太坑爹了我也用不上
  11. =end
  12. module M5Read  
  13. #==============================================================================
  14. #  设定部分
  15. #==============================================================================
  16.   
  17.   WIDTH = 60  
  18.   #设置窗口的宽度,数字越大窗口越小
  19.   
  20.   HEIGHT = 60
  21.   #设置窗口的高度,数字越大窗口越小
  22.   
  23.   SPEED = 3
  24.   #设置文字滚动的速度,数字越大速度越快
  25.   
  26.   SPACE = 9
  27.   #设置在文字开头和结尾部分的留空大小,数字越大留空越多
  28.   
  29. #==============================================================================
  30. #  设定结束
  31. #==============================================================================
  32. end
  33. #==============================================================================
  34. #  脚本部分
  35. #==============================================================================

  36. class Window_ScrollText < Window_Base
  37.   
  38.   def initialize
  39.     super(M5Read::WIDTH / 2, M5Read::HEIGHT / 3, winwidth, winheight)
  40.     self.opacity = 255
  41.     self.arrows_visible = true
  42.     hide
  43.   end
  44.   
  45.   def winwidth
  46.     Graphics.width - M5Read::WIDTH
  47.   end
  48.   
  49.   def winheight
  50.     Graphics.height - M5Read::HEIGHT
  51.   end  
  52.   
  53.   def update
  54.     super
  55.     if $game_message.scroll_mode
  56.       update_message_up if Input.press?(:UP)
  57.       update_message_down if Input.press?(:DOWN)
  58.       15.times {update_message_up} if Input.press?(:LEFT)
  59.       15.times {update_message_down} if Input.press?(:RIGHT)
  60.       terminate_message if (Input.repeat?(:B) or Input.repeat?(:C))
  61.       start_message if !@text && $game_message.has_text? && !Input.press?(:B)
  62.     end
  63.   end
  64.   
  65.   def start_message
  66.     @text = $game_message.all_text
  67.     self.oy = -M5Read::SPACE
  68.     refresh
  69.     show
  70.   end
  71.   
  72.   def refresh
  73.     reset_font_settings
  74.     update_all_text_height
  75.     create_contents
  76.     draw_text_ex(4, 0, @text)
  77.   end
  78.   
  79.   def update_all_text_height
  80.     @all_text_height = 1
  81.     convert_escape_characters(@text).each_line do |line|
  82.       @all_text_height += calc_line_height(line, false)
  83.     end
  84.     reset_font_settings
  85.   end
  86.   
  87.   def contents_height
  88.     @all_text_height ? @all_text_height : super
  89.   end
  90.   
  91.   def update_message_down
  92.     if contents.height < winheight-standard_padding*2-M5Read::SPACE
  93.       return
  94.     end
  95.     self.oy = [self.oy + scroll_speed,
  96.     contents.height - winheight + standard_padding * 2 + M5Read::SPACE ].min
  97.   end
  98.   
  99.   def update_message_up
  100.     if contents.height < winheight-standard_padding*2-M5Read::SPACE
  101.       return
  102.     end   
  103.     self.oy = [self.oy - scroll_speed,-M5Read::SPACE ].max
  104.   end
  105.   
  106.   def scroll_speed   
  107.     M5Read::SPEED   
  108.   end
  109.   
  110.   def terminate_message
  111.     @text = nil
  112.     $game_message.clear
  113.     hide
  114.   end
  115. end
  116. #==============================================================================
  117. #  脚本结束
  118. #==============================================================================
复制代码
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部