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

Project1

 找回密码
 注册会员
搜索
查看: 8899|回复: 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
星屑
50
在线时间
1 小时
注册时间
2008-7-28
帖子
432
77
 楼主| 发表于 2008-10-5 00:00:27 | 只看该作者
    算了,范例是对了,其他我自己解决吧,分给你了,最后想请某人介绍一本脚本方面的书,我想恶补下脚本。。。。。。。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

辉瑞中国首席研究员<

梦石
0
星屑
50
在线时间
142 小时
注册时间
2008-1-18
帖子
2129
76
发表于 2008-10-4 23:40:10 | 只看该作者
以下引用一醉倾城于2008-10-4 12:36:15的发言:


以下引用dbshy于2008-10-4 10:48:58的发言:

被LZ的精神所感,故帮忙遍了一个

没想到编这个东西用了我2个小时,其中调试用了1个多小时
水平越来越废柴了 = =bb

下面是自己可以调的参数

每次滚动条UP OR DOWN 的距离
DisTance = 400 / MaxPages

  滚动条的初始位置
  INI_X = 610
  INI_Y = 50
  
向下翻页,鼠标点击的响应位置
if (mouse_x > 580) and (mouse_y > 430) and
       (mouse_x < 640) and (mouse_y < 480) then
    向上翻页,鼠标点击的响应位置
   if (mouse_x > 580) and (mouse_y > 50) and
       (mouse_x < 640) and (mouse_y < 100) then

另外滚动条的图形自己设置,我随便用了个 = =  
设置部分在MAIN中,你应该找的到

可爱范例一头:
http://rpg.blue/upload_program/goods/Project50_103545725.rar


[本贴由作者于 2008-10-4 11:05:05 最后编辑]





感谢dbshy等了这么久终于有人帮忙了,你的范例很好很好,只是好像和鼠标系统冲突的样子?终于吧我把我的范例发上来,麻烦你帮忙整合下好吗?
这是范例:http://xianexs.mail.qq.com/cgi-bin/downloadfilepart/svrid246/%B7%B6%C0%FD.rar?svrid=246&fid=69861e5c2483fd08c9536084cc47f29a75299c34a854339a&&txf_fid=688627e42006201de8e434365aa684a0d98eaaea&&txf_sid=
这是下载的提取码:cd111669



还要售后服务,解决一个又冒出另一个新的不属于此问题范围内的问题,
这样以后没人会帮你 = =

这个就是基于鼠标系统,怎么会冲突???

你的范例懒得看,你把原来的SECEN_FILE全都删了,用我范例中的替换
然后把鼠标系统替换成我范例中的那个,其实是一样的,我的鼠标系统只是把SCENE_FILE
全都注释掉了 = =


来6r就是等某位仁兄的巨坑

褴褛着身行无端,囊中羞涩空心酸。
平生几无得意事,倒塔泡面宅寝室。
惟羡隔壁高帅富,雨露春风月夜声。
青丝无处觅其踪,只有硬盘苍井空。
莫云男儿空悲愁,鸿鹄岂不天际游。
坐断天下执鹿首,千百金帛万兜鍪。
夜深忽梦某年月,再见女神欲语迟。
吊丝终有逆袭日,木耳再无回粉时。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2008-7-28
帖子
432
75
 楼主| 发表于 2008-10-4 20:36:15 | 只看该作者
以下引用dbshy于2008-10-4 10:48:58的发言:

被LZ的精神所感,故帮忙遍了一个

没想到编这个东西用了我2个小时,其中调试用了1个多小时
水平越来越废柴了 = =bb

下面是自己可以调的参数

每次滚动条UP OR DOWN 的距离
DisTance = 400 / MaxPages

   滚动条的初始位置
   INI_X = 610
   INI_Y = 50
   
向下翻页,鼠标点击的响应位置
if (mouse_x > 580) and (mouse_y > 430) and
        (mouse_x < 640) and (mouse_y < 480) then
     向上翻页,鼠标点击的响应位置
    if (mouse_x > 580) and (mouse_y > 50) and
        (mouse_x < 640) and (mouse_y < 100) then

  另外滚动条的图形自己设置,我随便用了个 = =  
  设置部分在MAIN中,你应该找的到

可爱范例一头:
http://rpg.blue/upload_program/goods/Project50_103545725.rar


[本贴由作者于 2008-10-4 11:05:05 最后编辑]




感谢dbshy等了这么久终于有人帮忙了,你的范例很好很好,只是好像和鼠标系统冲突的样子?终于吧我把我的范例发上来,麻烦你帮忙整合下好吗?
这是范例:http://xianexs.mail.qq.com/cgi-b ... a&&txf_sid=
这是下载的提取码:cd111669
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
192 小时
注册时间
2007-7-14
帖子
2746
74
发表于 2008-10-4 18:51:17 | 只看该作者
一醉,有好心人帮你了~~快来看看~~

顺便也顶一下~~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

辉瑞中国首席研究员<

梦石
0
星屑
50
在线时间
142 小时
注册时间
2008-1-18
帖子
2129
73
发表于 2008-10-4 18:48:58 | 只看该作者
被LZ的精神所感,故帮忙遍了一个

没想到编这个东西用了我2个小时,其中调试用了1个多小时
水平越来越废柴了 = =bb

下面是自己可以调的参数

每次滚动条UP OR DOWN 的距离
DisTance = 400 / MaxPages

    滚动条的初始位置
    INI_X = 610
    INI_Y = 50
   
  向下翻页,鼠标点击的响应位置
  if (mouse_x > 580) and (mouse_y > 430) and
         (mouse_x < 640) and (mouse_y < 480) then
      向上翻页,鼠标点击的响应位置
     if (mouse_x > 580) and (mouse_y > 50) and
         (mouse_x < 640) and (mouse_y < 100) then

   另外滚动条的图形自己设置,我随便用了个 = =  
   设置部分在MAIN中,你应该找的到

  可爱范例一头:
  http://rpg.blue/upload_program/goods/Project50_103545725.rar
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
来6r就是等某位仁兄的巨坑

褴褛着身行无端,囊中羞涩空心酸。
平生几无得意事,倒塔泡面宅寝室。
惟羡隔壁高帅富,雨露春风月夜声。
青丝无处觅其踪,只有硬盘苍井空。
莫云男儿空悲愁,鸿鹄岂不天际游。
坐断天下执鹿首,千百金帛万兜鍪。
夜深忽梦某年月,再见女神欲语迟。
吊丝终有逆袭日,木耳再无回粉时。
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-10-2
帖子
130
72
发表于 2008-10-4 01:14:36 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2008-7-28
帖子
432
71
 楼主| 发表于 2008-10-2 23:05:36 | 只看该作者
    只要滚动条能用并不出错就可以了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
4 小时
注册时间
2008-8-20
帖子
159
70
发表于 2008-10-2 20:32:28 | 只看该作者
以下引用灯笼菜刀王于2008-9-27 21:22:58的发言:

http://rpg.blue/viewthread.php?tid=102029

这里里面就有那个效果-。-,可以尝试拆出来用~~ 不过,我拆不出来。

我把那拆掉给你~~,不过我只给效果,不给全data你~~~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
192 小时
注册时间
2007-7-14
帖子
2746
69
发表于 2008-10-2 05:42:47 | 只看该作者
以下引用suicaoya123于2008-10-1 17:27:46的发言:

话说我也想制作......而且我也提问过了2次.但都不满意,为什么不出个全局可用的滚动呢(被pia非....)

等待高手出现,弄个滚动条,受益大家~~
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-29 23:14

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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