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

Project1

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

2VIP,请人帮我加一个滚动条(分不够可以追加)

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2008-7-28
帖子
432
跳转到指定楼层
1
发表于 2008-9-7 21:12:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
    哪位帮帮忙,只要在我的存档脚本中加一个滚动条就可以了,因为貌似现在的存档业面4格一页,鼠标想再往下好象没有办法了,所以希望加一个支持鼠标的滚动条。。。。。。。。
    2VIP了= =那顺便帮我把物品和技能那里的滚动条也做下吧= =多谢。
这个是脚本:
  1. #==============================================================================
  2. # ■ Scene_File
  3. #------------------------------------------------------------------------------
  4. #  存档画面及读档画面的超级类。
  5. #   脚本优化: SailCat
  6. #==============================================================================

  7. class Scene_File
  8. #--------------------------------------------------------------------------
  9. # ● 常量 (存档页数)
  10. #--------------------------------------------------------------------------
  11. MaxPages = 25
  12. #--------------------------------------------------------------------------
  13. # ● 初始化对像
  14. #     help_text : 帮助窗口显示的字符串
  15. #--------------------------------------------------------------------------
  16. def initialize(help_text)
  17.   @help_text = help_text
  18.   @slots = MaxPages * 4
  19. end
  20. #--------------------------------------------------------------------------
  21. # ● 主处理
  22. #--------------------------------------------------------------------------
  23. def main
  24.   # This is setting up the background picture
  25.   @background = Sprite.new
  26.   @background.bitmap = RPG::Cache.picture("save window")
  27.   @background.x = 0
  28.   @background.y = 0

  29.   # ヘルプウィンドウを作成
  30.   @help_window = Window_Help.new
  31.   @help_window.opacity = 0
  32.   @help_window.set_text(@help_text)
  33.   # セーブファイルウィンドウを作成
  34.   # 生成帮助窗口
  35. #   @help_window = Window_Help.new
  36. #   @help_window.set_text(@help_text)
  37.   @file_index = $game_temp.last_file_index
  38.   # 生成存档文件窗口
  39.   @savefile_windows = []
  40.   # 选择最后操作的文件
  41.   for i in @file_index / 4 * 4..@file_index / 4 * 4 + 3
  42.     load_window(i)
  43.     @savefile_windows[i].visible = true
  44.   end
  45.   @savefile_windows[@file_index].selected = true
  46.   # 执行过渡
  47.   Graphics.transition
  48.   # 主循环
  49.   loop do
  50.     # 刷新游戏画面
  51.     Graphics.update
  52.     # 刷新输入信息
  53.     Input.update
  54.     # 刷新画面
  55.     update
  56.     # 如果画面被切换的话就中断循环
  57.     if $scene != self
  58.       break
  59.     end
  60.   end
  61. # 准备过渡
  62. Graphics.freeze
  63. # 释放窗口
  64. @help_window.dispose
  65. for i in 0...@slots
  66.    @savefile_windows[i].dispose if @savefile_windows[i] != nil
  67. end
  68. end
  69. #--------------------------------------------------------------------------
  70. # ● 刷新画面
  71. #--------------------------------------------------------------------------
  72. def update
  73. # 刷新窗口
  74. @help_window.update
  75. for i in @file_index / 4 * 4..@file_index / 4 * 4 + 3
  76.    @savefile_windows[i].update if @savefile_windows[i].visible
  77. end
  78. # 按下 C 键的情况下

  79.   # 按下 C 键的情况下
  80.   if Input.trigger?(Input::C)
  81.     # 调用过程 on_decision (定义继承目标)
  82.     on_decision(make_filename(@file_index))
  83.     $game_temp.last_file_index = @file_index
  84.     return
  85.   end
  86.   # 按下 B 键的情况下
  87.   if Input.trigger?(Input::B)
  88.     # 调用过程 on_cancel (定义继承目标)
  89.     on_cancel
  90.     return
  91.   end
  92.   # 按下方向键下的情况下
  93.   if Input.repeat?(Input::DOWN)
  94.     # 演奏光标 SE
  95.     $game_system.se_play($data_system.cursor_se)
  96.     # 光标向下移动
  97.     @savefile_windows[@file_index].selected = false
  98.     @file_index = (@file_index + 1) % @slots
  99.     # 翻到下一页的情况下
  100.     if @file_index % 4 == 0
  101.       for index in @file_index / 4 * 4..@file_index / 4 * 4 + 3
  102.         @savefile_windows[(index + @slots - 4) % @slots].visible = false
  103.         load_window(index)
  104.         @savefile_windows[index].visible = true
  105.       end
  106.     end
  107.     @savefile_windows[@file_index].selected = true
  108.     return
  109.   end
  110.   # 按下方向键上的情况下
  111.   if Input.repeat?(Input::UP)
  112.     # 演奏光标 SE
  113.     $game_system.se_play($data_system.cursor_se)
  114.     # 光标向上移动
  115.     @savefile_windows[@file_index].selected = false
  116.     @file_index = (@file_index + @slots - 1) % @slots
  117.     # 翻到上一页的情况下
  118.     if @file_index % 4 == 3
  119.       for index in @file_index / 4 * 4..@file_index / 4 * 4 + 3
  120.         @savefile_windows[(index + 4) % @slots].visible = false
  121.         load_window(index)
  122.         @savefile_windows[index].visible = true
  123.       end
  124.     end
  125.     @savefile_windows[@file_index].selected = true
  126.     return
  127.   end
  128.   # 按下方向键左或者 L 的情况下
  129.   if Input.repeat?(Input::LEFT) or Input.trigger?(Input::L)
  130.     # 演奏光标 SE
  131.     $game_system.se_play($data_system.cursor_se)
  132.     # 前翻一页
  133.     @savefile_windows[@file_index].selected = false
  134.     @file_index = (@file_index + @slots - 4) % @slots
  135.     for index in @file_index / 4 * 4..@file_index / 4 * 4 + 3
  136.       @savefile_windows[(index + 4) % @slots].visible = false
  137.       load_window(index)
  138.       @savefile_windows[index].visible = true
  139.     end
  140.     @savefile_windows[@file_index].selected = true
  141.     return
  142.   end
  143.   # 按下方向键右或者 R 的情况下
  144.   if Input.repeat?(Input::RIGHT) or Input.trigger?(Input::R)
  145.     # 演奏光标 SE
  146.     $game_system.se_play($data_system.cursor_se)
  147.     # 前翻一页
  148.     @savefile_windows[@file_index].selected = false
  149.     @file_index = (@file_index + 4) % @slots
  150.     for index in @file_index / 4 * 4..@file_index / 4 * 4 + 3
  151.       @savefile_windows[(index + @slots - 4) % @slots].visible = false
  152.       load_window(index)
  153.       @savefile_windows[index].visible = true
  154.     end
  155.     @savefile_windows[@file_index].selected = true
  156.     return
  157.   end
  158. end
  159. #--------------------------------------------------------------------------
  160. # ● 生成文件名
  161. #     file_index : 文件名的索引 (0~n)
  162. #--------------------------------------------------------------------------
  163. def make_filename(记录_index)
  164.   #return "Save#{file_index + 1}.rxdata"
  165.   return "Save#{记录_index + 1}.rxdata"
  166. end
  167. #--------------------------------------------------------------------------
  168. # ● 载入当前页存档
  169. #     避免因存档位过多造成的卡壳现象
  170. #--------------------------------------------------------------------------
  171. def load_window(i)
  172.   if @savefile_windows[i] != nil
  173.     return
  174.   else
  175.     @savefile_windows[i] = Window_SaveFile.new(i, make_filename(i))
  176.   end
  177. end
  178. end
复制代码

   这个是存档的图片:

此贴于 2008-9-8 10:35:23 被版主darkten提醒,请楼主看到后对本贴做出回应。



附加一个滚动条参考范例。。。窗口太多,我无从改起- -
http://rpg.blue/upload_program/files/mouse_0530_93058312.rar
此贴于 2008-9-9 21:18:05 被版主光郎提醒,请楼主看到后对本贴做出回应。
版务信息:本贴由楼主自主结贴~

Lv1.梦旅人

梦石
0
星屑
60
在线时间
41 小时
注册时间
2008-3-5
帖子
2072
2
发表于 2008-9-7 21:14:47 | 只看该作者
这个东西好象我做过!
你它囧一字母君谁记得……
当时那把剑离我的喉咙只有0.01工分。可是一柱香之后,这个女主人会深深的爱上我,虽然本人平生说了无数的谎话,可是这句最有效:“你应该这么做,我也应该死。
曾经有一取ID的机会放在我面前,我没有珍惜,等我失去的时候我才后悔莫及,人世间最痛苦的事莫过于此。你的剑在我的咽喉上割下去吧!不用再犹豫了!如果上天能够给我一个再来一次的机会,我绝对会取个汉字君。如果非要给这ID加点修饰的话,我希望是……红色加粗……

回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
1 小时
注册时间
2008-8-10
帖子
273
3
发表于 2008-9-7 21:31:59 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2008-7-28
帖子
432
4
 楼主| 发表于 2008-9-7 21:36:51 | 只看该作者
    不是滚动字幕,是滚动条,就像仙剑4里面的存档截面不是有一条往下拉的滑动图片的条吗?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2008-7-28
帖子
432
5
 楼主| 发表于 2008-9-7 22:41:35 | 只看该作者
沉了?
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-7-13
帖子
47
6
发表于 2008-9-7 23:11:46 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2008-7-28
帖子
432
7
 楼主| 发表于 2008-9-8 00:38:18 | 只看该作者
    不会吧?真的没人能做的出来?我在线等了好久的说= =
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2008-7-28
帖子
432
8
 楼主| 发表于 2008-9-8 04:20:17 | 只看该作者
    再顶最后一次了http://rpg.blue/upload_program/files/mouse_0530_93058312.rar
    这个范例可能会有帮助。。。我看不懂{/pz}里面的窗口太多了。。。。
   最后再次希望某位大大帮忙改出存档的滚动条。。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
5 小时
注册时间
2008-6-28
帖子
292
9
发表于 2008-9-8 04:40:35 | 只看该作者
不是滚动字幕,是滚动条,就像仙剑4里面的存档截面不是有一条往下拉的滑动图片的条吗?

难道是像现在网页中的那种下拉,滚动条。。。不知道是在那里显示的呢?
不要小看偶哦~~偶可是雨血2和历史2的主系统哦
回复 支持 反对

使用道具 举报

Lv1.梦旅人

剑圣

梦石
0
星屑
50
在线时间
122 小时
注册时间
2008-8-31
帖子
778
10
发表于 2008-9-8 06:39:33 | 只看该作者
楼主要做滚动条的话难度确实大了一点
如果是在存档界面增加两个按钮 向前/向后翻页 的话会好实现一些

这样的话只用修改存档脚本而不用改其他脚本,难度会降下很多...
不...其实这样就完全没有难度了,亿万的存档脚本已经把翻页做的很完美了,只是增加两个按钮的事情= =





PC/IOS/Android共享的RM RPG:未名大学
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-19 02:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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