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

Project1

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

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
809
在线时间
176 小时
注册时间
2017-1-15
帖子
81
跳转到指定楼层
1
发表于 2018-11-30 12:47:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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

然后我看了喵呜喵5的阅读系统,那个翻页很顺畅很喜欢,想让任务脚本的内容页面也能像这样翻页- -我用这两个脚本拼了好久都不成功,可以翻页,但是显示不完字,我设了2页的字,但结果只能显示一页的内容,第二页的字就出不来了
下面这是阅读系统 By喵呜喵5
RUBY 代码复制
  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.  
  37. class Window_ScrollText < Window_Base
  38.  
  39.   def initialize
  40.     super(M5Read::WIDTH / 2, M5Read::HEIGHT / 3, winwidth, winheight)
  41.     self.opacity = 255
  42.     self.arrows_visible = true
  43.     hide
  44.   end
  45.  
  46.   def winwidth
  47.     Graphics.width - M5Read::WIDTH
  48.   end
  49.  
  50.   def winheight
  51.     Graphics.height - M5Read::HEIGHT
  52.   end  
  53.  
  54.   def update
  55.     super
  56.     if $game_message.scroll_mode
  57.       update_message_up if Input.press?(:UP)
  58.       update_message_down if Input.press?(:DOWN)
  59.       15.times {update_message_up} if Input.press?(:LEFT)
  60.       15.times {update_message_down} if Input.press?(:RIGHT)
  61.       terminate_message if (Input.repeat?(:B) or Input.repeat?(:C))
  62.       start_message if !@text && $game_message.has_text? && !Input.press?(:B)
  63.     end
  64.   end
  65.  
  66.   def start_message
  67.     @text = $game_message.all_text
  68.     self.oy = -M5Read::SPACE
  69.     refresh
  70.     show
  71.   end
  72.  
  73.   def refresh
  74.     reset_font_settings
  75.     update_all_text_height
  76.     create_contents
  77.     draw_text_ex(4, 0, @text)
  78.   end
  79.  
  80.   def update_all_text_height
  81.     @all_text_height = 1
  82.     convert_escape_characters(@text).each_line do |line|
  83.       @all_text_height += calc_line_height(line, false)
  84.     end
  85.     reset_font_settings
  86.   end
  87.  
  88.   def contents_height
  89.     @all_text_height ? @all_text_height : super
  90.   end
  91.  
  92.   def update_message_down
  93.     if contents.height < winheight-standard_padding*2-M5Read::SPACE
  94.       return
  95.     end
  96.     self.oy = [self.oy + scroll_speed,
  97.     contents.height - winheight + standard_padding * 2 + M5Read::SPACE ].min
  98.   end
  99.  
  100.   def update_message_up
  101.     if contents.height < winheight-standard_padding*2-M5Read::SPACE
  102.       return
  103.     end   
  104.     self.oy = [self.oy - scroll_speed,-M5Read::SPACE ].max
  105.   end
  106.  
  107.   def scroll_speed   
  108.     M5Read::SPEED   
  109.   end
  110.  
  111.   def terminate_message
  112.     @text = nil
  113.     $game_message.clear
  114.     hide
  115.   end
  116. end
  117. #==============================================================================
  118. #  脚本结束
  119. #==============================================================================
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-4-24 07:14

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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