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

Project1

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

[已经解决] 状态窗口翻页?

[复制链接]

Lv2.观梦者

梦石
0
星屑
445
在线时间
377 小时
注册时间
2012-11-5
帖子
267
跳转到指定楼层
1
发表于 2013-9-30 17:44:47 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
状态窗口翻页

145.PNG (86.58 KB, 下载次数: 6)

145.PNG

1234.PNG (64.15 KB, 下载次数: 5)

1234.PNG

Lv1.梦旅人

薄凉看客

梦石
0
星屑
50
在线时间
1269 小时
注册时间
2010-6-20
帖子
1316
2
发表于 2013-9-30 18:26:02 | 只看该作者
表示可以用其他方式,解决。
全部角色都描绘上,但信息是不全的。
只有一个名字,如果光标在移动的话,会另外出现一个窗口,来描绘信息

照着默认Window_Help写就可以了,修改传递的参数为actor本身
也就是
在帮助窗口里,因为有了actor,就可以描绘角色的所有信息
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
445
在线时间
377 小时
注册时间
2012-11-5
帖子
267
3
 楼主| 发表于 2013-9-30 21:29:35 | 只看该作者
恋′挂机 发表于 2013-9-30 18:26
表示可以用其他方式,解决。
全部角色都描绘上,但信息是不全的。
只有一个名字,如果光标在移动的话,会另 ...

求范例或脚本
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

梦石
0
星屑
9532
在线时间
5073 小时
注册时间
2013-6-21
帖子
3580

开拓者贵宾剧作品鉴家

4
发表于 2013-9-30 21:40:17 | 只看该作者
楼主想问什么?
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
445
在线时间
377 小时
注册时间
2012-11-5
帖子
267
5
 楼主| 发表于 2013-9-30 21:46:34 | 只看该作者
RyanBern 发表于 2013-9-30 21:40
楼主想问什么?

像物品窗口显示,一面显示不了可以显示第二面
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

梦石
0
星屑
9532
在线时间
5073 小时
注册时间
2013-6-21
帖子
3580

开拓者贵宾剧作品鉴家

6
发表于 2013-9-30 22:11:56 | 只看该作者
789456qwe 发表于 2013-9-30 21:46
像物品窗口显示,一面显示不了可以显示第二面

首先,问下楼主是把脚本改了么?为什么每个角色下面空出来那么大?
其次,楼主要清楚,游戏默认队伍中最多只能容纳4个成员,也就是说,如果人满了,再怎么加入队员都是没用的。
  1. #==============================================================================
  2. # ■ Window_Selectable(改良版)
  3. #------------------------------------------------------------------------------
  4. #  拥有光标的移动以及滚动功能的窗口类。
  5. #   改编:RyanBern
  6. #==============================================================================

  7. class Window_Selectable < Window_Base
  8.   #--------------------------------------------------------------------------
  9.   # ● 定义实例变量
  10.   #--------------------------------------------------------------------------
  11.   attr_reader   :index                    # 光标位置
  12.   attr_reader   :help_window              # 帮助窗口
  13.   attr_accessor :row_height               # 行高
  14.   #--------------------------------------------------------------------------
  15.   # ● 初始画对像
  16.   #     x      : 窗口的 X 坐标
  17.   #     y      : 窗口的 Y 坐标
  18.   #     width  : 窗口的宽
  19.   #     height : 窗口的高
  20.   #     row_height : 行高 默认是32
  21.   #--------------------------------------------------------------------------
  22.   def initialize(x, y, width, height, row_height=32)
  23.     super(x, y, width, height)
  24.     @item_max = 1
  25.     @column_max = 1
  26.     [url=home.php?mod=space&uid=370741]@Index[/url] = -1
  27.     @row_height = row_height
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 设置光标的位置
  31.   #     index : 新的光标位置
  32.   #--------------------------------------------------------------------------
  33.   def index=(index)
  34.     @index = index
  35.     # 刷新帮助文本 (update_help 定义了继承目标)
  36.     if self.active and @help_window != nil
  37.       update_help
  38.     end
  39.     # 刷新光标矩形
  40.     update_cursor_rect
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ● 获取行数
  44.   #--------------------------------------------------------------------------
  45.   def row_max
  46.     # 由项目数和列数计算出行数
  47.     return (@item_max + @column_max - 1) / @column_max
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● 获取开头行
  51.   #--------------------------------------------------------------------------
  52.   def top_row
  53.     # 将窗口内容的传送源 Y 坐标、1 行的高 rou_height 等分
  54.     return self.oy / @row_height
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ● 设置开头行
  58.   #     row : 显示开头的行
  59.   #--------------------------------------------------------------------------
  60.   def top_row=(row)
  61.     # row 未满 0 的场合更正为 0
  62.     if row < 0
  63.       row = 0
  64.     end
  65.     # row 超过 row_max - 1 的情况下更正为 row_max - 1
  66.     if row > row_max - 1
  67.       row = row_max - 1
  68.     end
  69.     # row 1 行高的 32 倍、窗口内容的传送源 Y 坐标
  70.     self.oy = row * @row_height
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # ● 获取 1 页可以显示的行数
  74.   #--------------------------------------------------------------------------
  75.   def page_row_max
  76.     # 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 row_height
  77.     return (self.height - 32) / @row_height
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # ● 获取 1 页可以显示的项目数
  81.   #--------------------------------------------------------------------------
  82.   def page_item_max
  83.     # 将行数 page_row_max 乘上列数 @column_max
  84.     return page_row_max * @column_max
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● 帮助窗口的设置
  88.   #     help_window : 新的帮助窗口
  89.   #--------------------------------------------------------------------------
  90.   def help_window=(help_window)
  91.     @help_window = help_window
  92.     # 刷新帮助文本 (update_help 定义了继承目标)
  93.     if self.active and @help_window != nil
  94.       update_help
  95.     end
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # ● 更新光标举行
  99.   #--------------------------------------------------------------------------
  100.   def update_cursor_rect
  101.     # 光标位置不满 0 的情况下
  102.     if @index < 0
  103.       self.cursor_rect.empty
  104.       return
  105.     end
  106.     # 获取当前的行
  107.     row = @index / @column_max
  108.     # 当前行被显示开头行前面的情况下
  109.     if row < self.top_row
  110.       # 从当前行向开头行滚动
  111.       self.top_row = row
  112.     end
  113.     # 当前行被显示末尾行之后的情况下
  114.     if row > self.top_row + (self.page_row_max - 1)
  115.       # 从当前行向末尾滚动
  116.       self.top_row = row - (self.page_row_max - 1)
  117.     end
  118.     # 计算光标的宽
  119.     cursor_width = self.width / @column_max - 32
  120.     # 计算光标坐标
  121.     x = @index % @column_max * (cursor_width + 32)
  122.     y = @index / @column_max * @row_height - self.oy
  123.     # 更新国标矩形
  124.     self.cursor_rect.set(x, y, cursor_width, @row_height)
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ● 刷新画面
  128.   #--------------------------------------------------------------------------
  129.   def update
  130.     super
  131.     # 可以移动光标的情况下
  132.     if self.active and @item_max > 0 and @index >= 0
  133.       # 方向键下被按下的情况下
  134.       if Input.repeat?(Input::DOWN)
  135.         # 列数不是 1 并且方向键的下的按下状态不是重复的情况、
  136.         # 或光标位置在(项目数-列数)之前的情况下
  137.         if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
  138.            @index < @item_max - @column_max
  139.           # 光标向下移动
  140.           $game_system.se_play($data_system.cursor_se)
  141.           @index = (@index + @column_max) % @item_max
  142.         end
  143.       end
  144.       # 方向键上被按下的情况下
  145.       if Input.repeat?(Input::UP)
  146.         # 列数不是 1 并且方向键的下的按下状态不是重复的情况、
  147.         # 或光标位置在列之后的情况下
  148.         if (@column_max == 1 and Input.trigger?(Input::UP)) or
  149.            @index >= @column_max
  150.           # 光标向上移动
  151.           $game_system.se_play($data_system.cursor_se)
  152.           @index = (@index - @column_max + @item_max) % @item_max
  153.         end
  154.       end
  155.       # 方向键右被按下的情况下
  156.       if Input.repeat?(Input::RIGHT)
  157.         # 列数为 2 以上并且、光标位置在(项目数 - 1)之前的情况下
  158.         if @column_max >= 2 and @index < @item_max - 1
  159.           # 光标向右移动
  160.           $game_system.se_play($data_system.cursor_se)
  161.           @index += 1
  162.         end
  163.       end
  164.       # 方向键左被按下的情况下
  165.       if Input.repeat?(Input::LEFT)
  166.         # 列数为 2 以上并且、光标位置在 0 之后的情况下
  167.         if @column_max >= 2 and @index > 0
  168.           # 光标向左移动
  169.           $game_system.se_play($data_system.cursor_se)
  170.           @index -= 1
  171.         end
  172.       end
  173.       # R 键被按下的情况下
  174.       if Input.repeat?(Input::R)
  175.         # 显示的最后行在数据中最后行上方的情况下
  176.         if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
  177.           # 光标向后移动一页
  178.           $game_system.se_play($data_system.cursor_se)
  179.           @index = [@index + self.page_item_max, @item_max - 1].min
  180.           self.top_row += self.page_row_max
  181.         end
  182.       end
  183.       # L 键被按下的情况下
  184.       if Input.repeat?(Input::L)
  185.         # 显示的开头行在位置 0 之后的情况下
  186.         if self.top_row > 0
  187.           # 光标向前移动一页
  188.           $game_system.se_play($data_system.cursor_se)
  189.           @index = [@index - self.page_item_max, 0].max
  190.           self.top_row -= self.page_row_max
  191.         end
  192.       end
  193.     end
  194.     # 刷新帮助文本 (update_help 定义了继承目标)
  195.     if self.active and @help_window != nil
  196.       update_help
  197.     end
  198.     # 刷新光标矩形
  199.     update_cursor_rect
  200.   end
  201. end


  202. #==============================================================================
  203. # ■ Window_MenuStatus
  204. #------------------------------------------------------------------------------
  205. #  显示菜单画面和同伴状态的窗口。
  206. #==============================================================================

  207. class Window_MenuStatus < Window_Selectable
  208.   #--------------------------------------------------------------------------
  209.   # ● 初始化目标
  210.   #--------------------------------------------------------------------------
  211.   def initialize
  212.     super(0, 0, 480, 480, 224)
  213.     self.contents = Bitmap.new(width - 32, $game_party.actors.size == 0 ? height - 32 : 224 * $game_party.actors.size)
  214.     refresh
  215.     self.active = false
  216.     self.index = -1
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ● 刷新
  220.   #--------------------------------------------------------------------------
  221.   def refresh
  222.     self.contents.clear
  223.     @item_max = $game_party.actors.size
  224.     for i in 0...$game_party.actors.size
  225.       x = 64
  226.       y = i * 224
  227.       actor = $game_party.actors[i]
  228.       draw_actor_graphic(actor, x - 40, y + 80)
  229.       draw_actor_name(actor, x, y)
  230.       draw_actor_class(actor, x + 144, y)
  231.       draw_actor_level(actor, x, y + 32)
  232.       draw_actor_state(actor, x + 90, y + 32)
  233.       draw_actor_exp(actor, x, y + 64)
  234.       draw_actor_hp(actor, x + 236, y + 32)
  235.       draw_actor_sp(actor, x + 236, y + 64)
  236.     end
  237.   end
  238.   def update_cursor_rect
  239.     super
  240.   end
  241. end
复制代码

这个代码的前半部分我发了很多次,就是更改Window_Selectable里面的行高,应该能满足你的翻页效果。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

薄凉看客

梦石
0
星屑
50
在线时间
1269 小时
注册时间
2010-6-20
帖子
1316
7
发表于 2013-9-30 22:42:49 | 只看该作者
本帖最后由 恋′挂机 于 2013-9-30 23:01 编辑

另辟蹊径我也写了个
  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================

  6. class Window_MenuStatus < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化目标
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 0, 480, 480)
  12.     self.contents = Bitmap.new(width - 32, 224 * $game_party.actors.size)
  13.     refresh
  14.     self.active = false
  15.     self.index = -1
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 刷新
  19.   #--------------------------------------------------------------------------
  20.   def refresh(page = 1)
  21.     self.contents.clear
  22.     @item_max = $game_party.actors.size
  23.     for i in 0...@item_max
  24.       x = 64
  25.       if page == 2
  26.       y = (i-2) * 224
  27.       else
  28.       y = i * 224
  29.       end
  30.       actor = $game_party.actors[i]
  31.       draw_actor_graphic(actor, x - 40, y + 80)
  32.       draw_actor_name(actor, x, y)
  33.       draw_actor_class(actor, x + 144, y)
  34.       draw_actor_level(actor, x, y + 32)
  35.       draw_actor_state(actor, x + 90, y + 32)
  36.       draw_actor_exp(actor, x, y + 64)
  37.       draw_actor_hp(actor, x + 236, y + 32)
  38.       draw_actor_sp(actor, x + 236, y + 64)
  39.     end
  40.   end
  41.   #--------------------------------------------------------------------------
  42.   # ● 刷新光标矩形
  43.   #--------------------------------------------------------------------------
  44.   def update_cursor_rect
  45.     if @index < 0
  46.       self.cursor_rect.empty
  47.     elsif @index > 1
  48.       self.cursor_rect.set(0, (@index-2) * 224, self.width - 32, 224)
  49.       if @index != @old_index
  50.       refresh(2)
  51.       @old_index = @index
  52.       end
  53.     else
  54.       self.cursor_rect.set(0, @index * 224, self.width - 32, 224)
  55.       if @index != @old_index
  56.       refresh(1)
  57.       @old_index = @index
  58.       end
  59.     end
  60.   end
  61. end
复制代码

点评

哪怕你说这是你写的也是允许的。  发表于 2013-9-30 23:08
脚本请随意使用哪怕你说这是你也的也是允许的。  发表于 2013-9-30 23:07

评分

参与人数 1星屑 +75 收起 理由
myownroc + 75 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
445
在线时间
377 小时
注册时间
2012-11-5
帖子
267
8
 楼主| 发表于 2013-10-1 11:03:12 | 只看该作者
RyanBern 发表于 2013-9-30 22:11
首先,问下楼主是把脚本改了么?为什么每个角色下面空出来那么大?
其次,楼主要清楚,游戏默认队伍中最 ...

问下楼主是把脚本改了么?    y= i  * 116改成y = i  * 240
为什么每个角色下面空出来那么大?
我会添加图片头像与血条
谢谢!
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
445
在线时间
377 小时
注册时间
2012-11-5
帖子
267
9
 楼主| 发表于 2013-10-1 11:04:20 | 只看该作者
恋′挂机 发表于 2013-9-30 22:42
另辟蹊径我也写了个

谢谢!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-30 06:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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