赞 | 4 |
VIP | 0 |
好人卡 | 0 |
积分 | 79 |
经验 | 15725 |
最后登录 | 2024-11-30 |
在线时间 | 1349 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 7852
- 在线时间
- 1349 小时
- 注册时间
- 2015-8-15
- 帖子
- 754
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
#============================================================================== # ■ 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 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 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 draw_status end 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
#==============================================================================
# ■ 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
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
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
draw_status
end
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
|
评分
-
查看全部评分
|