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

Project1

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

[已经过期] 选择任何一个角色光标老是返回到一个角色求解

[复制链接]

Lv4.逐梦者

梦石
0
星屑
7559
在线时间
1315 小时
注册时间
2015-8-15
帖子
747
跳转到指定楼层
1
发表于 2016-1-25 17:28:42 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 金芒芒 于 2016-1-25 17:29 编辑

[attach]
300272[/attach]
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================
  6.  
  7.  
  8.  
  9.  
  10. class Window_MenuStatus < Window_Selectable
  11.   #--------------------------------------------------------------------------
  12.   # ● 初始化对像
  13.   #--------------------------------------------------------------------------
  14.   def initialize(index = 0)
  15.     super(0, 64, 1200, 480)
  16.     self.contents = Bitmap.new(width - 32, height - 32)
  17.     refresh
  18.     self.index = index
  19.  
  20.   end
  21.   #--------------------------------------------------------------------------
  22.   # ● 刷新
  23.   #--------------------------------------------------------------------------
  24.     def refresh
  25.  
  26.     self.contents.clear
  27.    # @item_max = 4 #$game_party.actors.size
  28.   #  @item_may = 4
  29.   #  @column_max = 4
  30.   #  for i in 0...4   #$game_party.actors.size
  31.  
  32.    #   x = i * 116
  33.     #  y = 0
  34.  
  35.     @item_max = $game_party.actors.size
  36.     for i in 0...$game_party.actors.size
  37.     x = ( i + 1 ) * 92 +25
  38.     y = 44
  39.  
  40.     @column_max = 4
  41.  
  42.  
  43.     actor = $game_party.actors[i]
  44.     bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_h") #RPG::Cache.character(actor.character_name, actor.character_hue)
  45.     cw = bitmap.width
  46.     ch = bitmap.height
  47.     src_rect = Rect.new(0, 0, cw, ch)
  48.     self.contents.blt(x - ch , y - cw/ 2, bitmap, src_rect)
  49.       #draw_actor_graphic(actor, x - 40, y + 80)
  50.      # draw_actor_name(actor, x, y)
  51. #      draw_actor_class(actor, x + 144, y)
  52. #      draw_actor_level(actor, x, y + 32)
  53. #     draw_actor_state(actor, x + 90, y + 32)
  54. #      draw_actor_exp(actor, x, y + 64)
  55. #      draw_actor_hp(actor, x + 236, y + 32)
  56. #      draw_actor_sp(actor, x + 236, y + 64)
  57.  
  58.     draw_item(i)
  59.     end
  60.   end
  61.  
  62.     #--------------------------------------------------------------------------
  63.   # ● 更新光标举行
  64.   #--------------------------------------------------------------------------
  65.   def draw_item(index, color = normal_color)
  66.     self.contents.font.color = color
  67.     x = 104 + index * 80 + 40
  68. #    self.contents.draw_text(x-11, 0, 44, 32, @menustatus[index])
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # ● 项目无效化
  72.   #     index : 项目编号
  73.   #--------------------------------------------------------------------------
  74.   def disable_item(index)
  75.     draw_item(index, disabled_color)
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ● 刷新光标矩形
  79.   #--------------------------------------------------------------------------
  80. def update_cursor_rect
  81.     # 光标位置不满 0 的情况下
  82.     if @index <= -1
  83.       self.cursor_rect.empty
  84.  
  85.       return
  86.     end
  87.     # 获取当前的行
  88.     row = @index / @column_max
  89.     # 当前行被显示开头行前面的情况下
  90.     if row < self.top_row
  91.       # 从当前行向开头行滚动
  92.       self.top_row = row
  93.     end
  94.     # 当前行被显示末尾行之后的情况下
  95.     if row > self.top_row + (self.page_row_max - 1)
  96.       # 从当前行向末尾滚动
  97.       self.top_row = row - (self.page_row_max - 1)
  98.     end
  99.     # 计算光标的宽
  100.     cursor_width = 90
  101.     #cursor_width = 536 / (@column_max + 1) + 1  #光标大小
  102.     # 计算光标坐标
  103.  
  104.     x = 0 + @index % @column_max * (cursor_width + 1) - 4 #光标位置调节 覆盖31行
  105.     y = @index / @column_max * 32 - self.oy
  106.     # 更新国标矩形
  107.     self.cursor_rect.set(x, y, cursor_width, 128)#(x, y, cursor_width, 32)
  108.  
  109.     end
  110.  
  111.   end



选择第2角色光标使用后就跳到第一个角色去了

2016新制作.zip

925.8 KB, 下载次数: 43

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

本版积分规则

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

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

GMT+8, 2024-9-22 19:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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