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

Project1

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

[已经过期] 菜单界面箭头【不知道怎么在标题描述这个问题- -】

[复制链接]

Lv2.观梦者

梦石
0
星屑
719
在线时间
684 小时
注册时间
2009-5-29
帖子
461
跳转到指定楼层
1
发表于 2012-3-29 09:54:04 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
先上图:



请注意任务状态下的 箭头 “↓”

我想把它改成左右滚动而不是上下改动,并且每次滚动只移动1个index而不是翻页(4个index),求指教……

Lv1.梦旅人

梦石
0
星屑
50
在线时间
69 小时
注册时间
2012-3-3
帖子
79
2
发表于 2012-3-29 10:19:46 | 只看该作者
目测楼主的菜单画面显示队员的那个窗口是修改Window_MenuStatus的
class Window_MenuStatus < Window_Selectable

  #--------------------------------------------------------------------------
  # ● 获取列数
# 关键是增加此函数,其他细微的修改自己摸索吧
#--------------------------------------------------------------------------
  def col_max
    return 4#一行显示4个角色
end

end
内事不决问@度娘,外事不决问@谷哥。
有此二人辅佐,何愁天下不定乎!
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
719
在线时间
684 小时
注册时间
2009-5-29
帖子
461
3
 楼主| 发表于 2012-3-29 10:53:28 | 只看该作者
@殇殃

箭头什么的搞定了,但是现在的问题是col_max
如果定义col_max为4的话,当队员超出4名时,光标会移出画面外并且画面不会卷动;如果定义col_max为item_max的话又显得太挤了- -
回复 支持 反对

使用道具 举报

Lv3.寻梦者

虚空人形

梦石
0
星屑
4517
在线时间
2037 小时
注册时间
2011-8-11
帖子
3398

贵宾

4
发表于 2012-3-29 10:57:34 | 只看该作者
你指的是在队员多过4人时,可以左右移动来查看替补队员吗?

点评

嗯,现在基本上这个功能解决了- - 又有新问题,就是队员超过4个人时,光标和画面都移动了,但是描绘不出index>3之后的人物状态……  发表于 2012-3-29 11:14
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
465
在线时间
915 小时
注册时间
2011-5-11
帖子
438
5
发表于 2012-3-29 11:19:17 手机端发表。 | 只看该作者
提供你一个思路:1参考横向命令脚本限制光标移动
2扩大容器宽度,限制其高度
手机不好写教本,我明天会写这个的修改教程
http://rpg.blue/static/image/smiley/yct/A059.gif中国字认识都不到一半,哪的心情学英语呀!
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
719
在线时间
684 小时
注册时间
2009-5-29
帖子
461
6
 楼主| 发表于 2012-3-29 11:23:03 | 只看该作者
@hcm


其实后面两个空白位是有人的,但是描绘不出来,光标可以移动,求解……

附上脚本:
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Window_MenuStatus
  4. #------------------------------------------------------------------------------
  5. #  菜单画面中,显示队伍成员状态的窗口
  6. #==============================================================================

  7. class Window_MenuStatus < Window_Selectable
  8.   #--------------------------------------------------------------------------
  9.   # ● 定义实例变量
  10.   #--------------------------------------------------------------------------
  11.   attr_reader   :pending_index            # 保留位置(整队用)
  12.   #--------------------------------------------------------------------------
  13.   # ● 初始化对象
  14.   #--------------------------------------------------------------------------
  15.   def initialize(x, y)
  16.     super(x, y, window_width, window_height)
  17.     @pending_index = -1
  18.     refresh
  19.   end
  20.   #--------------------------------------------------------------------------
  21.   # ● 获取一页內显示的行数
  22.   #--------------------------------------------------------------------------
  23.   def page_row_max
  24.     1
  25.   end
  26.   #--------------------------------------------------------------------------
  27.   # ● 获取行数
  28.   #--------------------------------------------------------------------------
  29.   def row_max
  30.     1
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● 获取窗口的宽度
  34.   #--------------------------------------------------------------------------
  35.   def window_width
  36.     Graphics.width
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 获取窗口的高度
  40.   #--------------------------------------------------------------------------
  41.   def window_height
  42.     Graphics.height - 96
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   # ● 获取项目数
  46.   #--------------------------------------------------------------------------
  47.   def item_max
  48.     $game_party.members.size
  49.   end
  50.   def col_max
  51.     4
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 获取项目的绘制矩形
  55.   #--------------------------------------------------------------------------
  56.   def item_rect(index)
  57.     rect = Rect.new
  58.     rect.width = item_width
  59.     rect.height = item_height
  60.     rect.x = index * (item_width + spacing)
  61.     rect.y = index / item_max * item_height
  62.     rect
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ● 获取项目的高度
  66.   #--------------------------------------------------------------------------
  67.   def item_height
  68.     Graphics.height - 120
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # ● 绘制项目
  72.   #--------------------------------------------------------------------------
  73.   def draw_item(index)
  74.     actor = $game_party.members[index]
  75.     enabled = $game_party.battle_members.include?(actor)
  76.     rect = item_rect(index)
  77.     draw_item_background(index)
  78.     draw_actor_name_ms(actor, rect.x + 1, rect.y + 1)
  79.     change_color(system_color)
  80.     contents.fill_rect(rect.x, rect.y + 35, 120, 2, line_color)
  81.     contents.fill_rect(rect.x, rect.y + 203, 120, 2, line_color)
  82.     contents.fill_rect(rect.x, rect.y + 349, 120, 2, line_color)
  83.     change_color(normal_color)
  84.     draw_actor_class_ms(actor, rect.x + 1, rect.y + 48)
  85.     draw_actor_face(actor, rect.x + 12, rect.y + 84, enabled)
  86.     draw_actor_simple_status_2(actor, rect.x + 1, rect.y + 216)
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ● 获取水平线的颜色
  90.   #--------------------------------------------------------------------------
  91.   def line_color
  92.     color = normal_color
  93.     color.alpha = 48
  94.     color
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● 绘制简单的状态
  98.   #--------------------------------------------------------------------------
  99.   def draw_actor_simple_status_2(actor, x, y)
  100.     draw_actor_level_ms(actor, x , y)
  101.     draw_actor_icons(actor, x, y + line_height * 1, width =120)
  102.     draw_actor_hp(actor, x, y + line_height * 2, width = 120)
  103.     draw_actor_mp(actor, x, y + line_height * 3, width = 120)
  104.     draw_exp_ms(actor, x, y + line_height * 4, width = 120)
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 経験値情報の描画
  108.   #--------------------------------------------------------------------------
  109.   def draw_exp_ms(actor, x, y, width)
  110.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  111.     change_color(normal_color)
  112.     draw_actor_exp_gauge(actor, x, y, width)
  113.     change_color(system_color)
  114.     draw_text(x, y + line_height * 0, width, line_height, s_next)
  115.     change_color(normal_color)
  116.     draw_text(x, y + line_height * 0, width, line_height, (actor.exp_rate * 100).round.to_s + "%", 2)
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ● 绘制项目的背景
  120.   #--------------------------------------------------------------------------
  121.   def draw_item_background(index)
  122.     if index == @pending_index
  123.       contents.fill_rect(item_rect(index), pending_color)
  124.     end
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ● 按下确定键时的处理
  128.   #--------------------------------------------------------------------------
  129.   def process_ok
  130.     super
  131.     $game_party.menu_actor = $game_party.members[index]
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● 返回上一个选择的位置
  135.   #--------------------------------------------------------------------------
  136.   def select_last
  137.     select($game_party.menu_actor.index || 0)
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ● 设置保留位置(整队用)
  141.   #--------------------------------------------------------------------------
  142.   def pending_index=(index)
  143.     last_pending_index = @pending_index
  144.     @pending_index = index
  145.     redraw_item(@pending_index)
  146.     redraw_item(last_pending_index)
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ● 绘制名字
  150.   #--------------------------------------------------------------------------
  151.   def draw_actor_name_ms(actor, x, y, width = 120)
  152.     change_color(hp_color(actor))
  153.     draw_text(x, y, width, line_height, actor.name, 1)
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # ● 绘制职业
  157.   #--------------------------------------------------------------------------
  158.   def draw_actor_class_ms(actor, x, y, width = 120)
  159.     change_color(normal_color)
  160.     draw_text(x, y, width, line_height, actor.class.name, 1)
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # ● 绘制等级
  164.   #--------------------------------------------------------------------------
  165.   def draw_actor_level_ms(actor, x, y)
  166.     change_color(system_color)
  167.     draw_text(x, y, 32, line_height, Vocab::level_a)
  168.     change_color(normal_color)
  169.     draw_text(x + 32, y, 88, line_height, actor.level, 2)
  170.   end
  171.   
  172.   #--------------------------------------------------------------------------
  173.   # ● 光标向下移动
  174.   #--------------------------------------------------------------------------
  175.   def cursor_down(wrap = false)
  176.     if index < item_max - 1
  177.       select(index + 1)
  178.     else
  179.       select(0)
  180.     end
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # ● 光标向上移动
  184.   #--------------------------------------------------------------------------
  185.   def cursor_up(wrap = false)
  186.     if index == 0
  187.       select(item_max - 1)
  188.     else
  189.       select(index - 1)
  190.     end
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ● 光标向右移动
  194.   #--------------------------------------------------------------------------
  195.   def cursor_right(wrap = false)
  196.     if index < item_max - 1
  197.       select(index + 1)
  198.     else
  199.       select(0)
  200.     end
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● 光标向左移动
  204.   #--------------------------------------------------------------------------
  205.   def cursor_left(wrap = false)
  206.     if index == 0
  207.       select(item_max - 1)
  208.     else
  209.       select(index - 1)
  210.     end
  211.   end
  212.   #--------------------------------------------------------------------------
  213.   # ● 光标移至下一页
  214.   #--------------------------------------------------------------------------
  215.   def cursor_pagedown
  216.     if top_row + page_row_max < row_max
  217.       self.top_row += page_row_max
  218.       select([@index + page_item_max, item_max - 1].min)
  219.     end
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # ● 光标移至上一页
  223.   #--------------------------------------------------------------------------
  224.   def cursor_pageup
  225.     if top_row > 0
  226.       self.top_row -= page_row_max
  227.       select([@index - page_item_max, 0].max)
  228.     end
  229.   end
  230. #===============================================================================
  231.   #--------------------------------------------------------------------------
  232.   # ● 获取当前行
  233.   #--------------------------------------------------------------------------
  234.   def col
  235.     index
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # ● 获取顶行位置
  239.   #--------------------------------------------------------------------------
  240.   def top_col
  241.     ox / item_width
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # ● 设置顶行位置
  245.   #--------------------------------------------------------------------------
  246.   def top_col=(col)
  247.     col = 0 if col < 0
  248.     col = col_max - 1 if col > col_max - 1
  249.     self.ox = col * (item_width + spacing)
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ● 获取末行位置
  253.   #--------------------------------------------------------------------------
  254.   def bottom_col
  255.     top_col + 3
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ● 设置末行位置
  259.   #--------------------------------------------------------------------------
  260.   def bottom_col=(col)
  261.     self.top_col = col - 3
  262.   end
  263.   #--------------------------------------------------------------------------
  264.   # ● 确保光标在画面范围内滚动
  265.   #--------------------------------------------------------------------------
  266.   def ensure_cursor_visible
  267.     self.top_col = col if col < top_col
  268.     self.bottom_col = col if col > bottom_col
  269.   end
  270. end
复制代码

点评

hcm
被召唤进来了,不过可能帮不上忙了,目前我也在研究这个脚本,目前界面事实上比你的还糟糕呢, 小镜子和345912390可能会懂吧。  发表于 2012-3-29 14:02
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-5 08:01

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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