| 赞 | 46 |
| VIP | |
| 好人卡 | |
| 积分 | 97 |
| 经验 | |
| 最后登录 | 2026-6-17 |
| 在线时间 | 2775 小时 |
梦石0
星屑9716
在线时间2775 小时
注册时间2008-9-5
回帖3458
   
|
发表于 2016-3-2 22:56:44
|
显示全部楼层
本帖最后由 cinderelmini 于 2016-3-2 22:58 编辑
- #==============================================================================
- # ■ Window_Character
- #------------------------------------------------------------------------------
- # 角色索引窗口
- #==============================================================================
-
- class Window_Character < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 133, 800, 480)#(160, 84, 385, 480)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.z += 10
- self.opacity = HS::OPACITY
- # self.contents.font.size = 20
- @item_max = $game_party.actors.size
- # @column_max = $game_party.actors.size
- @column_max = 4
- @old_index = self.index
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...$game_party.actors.size
- x = 130 + i % 4 * (53 + 32) # 根据包裹坐标修改过来的
- y = 44 + i / 4 * 128
- actor = $game_party.actors[i]
- bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_h") #RPG::Cache.character(actor.character_name, actor.character_hue)
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch + 50)
- self.contents.blt(x - ch , y - cw/ 2, bitmap, src_rect)
- end
- draw_status
- @old_index = self.index
- end
-
- #--------------------------------------------------------------------------
- # ● 描绘半身像
- #--------------------------------------------------------------------------
- def draw_status
- actor = $game_party.actors[@index]
- bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_b")
- src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
- self.contents.blt(365 , 0, bitmap, src_rect,200)
- end
-
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- # 光标位置不满 0 的情况下
- if @index <= - 1
- self.cursor_rect.empty
- return
- end
- # 获取当前的行
- row = @index / @column_max
- # 当前行被显示开头行前面的情况下
- if row < self.top_row
- # 从当前行向开头行滚动
- self.top_row = row
- end
- # 当前行被显示末尾行之后的情况下
- if row > self.top_row + (self.page_row_max - 1)
- # 从当前行向末尾滚动
- self.top_row = row - (self.page_row_max - 1)
- end
- # 计算光标的宽
- cursor_width = 86
- #cursor_width = 536 / (@column_max + 1) + 1 #光标大小
- # 计算光标坐标
-
- x = 1 + @index % @column_max * (cursor_width - 1) - 6#光标位置调节 覆盖31行
- y = @index / @column_max * 128 - self.oy - 3
- # 更新国标矩形
- self.cursor_rect.set(x+14, y+3, cursor_width, 123)#(x, y, cursor_width, 32)
-
- refresh if @old_index != self.index
- end
-
- end
复制代码 |
评分
-
查看全部评分
|