赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 2117 |
最后登录 | 2015-2-26 |
在线时间 | 74 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 74 小时
- 注册时间
- 2011-2-16
- 帖子
- 23
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
- [code][code]#==============================================================================
- # ■ Window_EquipRight
- #------------------------------------------------------------------------------
- # 装备画面、显示角色现在装备的物品的窗口。
- #==============================================================================
- class Window_EquipRight_New < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------[code]
复制代码 def initialize(actor)
#super(160, 48, 240, 352)
super(285, 17, 256, 300)
self.windowskin = RPG::Cache.windowskin("../system/menu/windowskins/palskin")
self.opacity = 0
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ● 获取物品
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
@data.push($data_armors[@actor.armor5_id])
@data.push($data_armors[@actor.armor6_id])
@data.push($data_armors[@actor.armor7_id])
@item_max = @data.size
self.contents.font.color = system_color
self.contents.font.size = 20
self.contents.draw_text(4, 0, 92, 32, $data_system.words.weapon)
self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
self.contents.draw_text(4, 32 * 4, 92, 32, $data_system.words.armor4)
self.contents.draw_text(4, 32 * 5, 92, 32, "鞋")
self.contents.draw_text(4, 32 * 6, 92, 32, "法宝1")
self.contents.draw_text(4, 32 * 7, 92, 32, "法宝2")
draw_item_name(@data[0], 64, 32 * 0, 18)
draw_item_name(@data[1], 64, 32 * 1, 18)
draw_item_name(@data[2], 64, 32 * 2, 18)
draw_item_name(@data[3], 64, 32 * 3, 18)
draw_item_name(@data[4], 64, 32 * 4, 18)
draw_item_name(@data[5], 64, 32 * 5, 18)
draw_item_name(@data[6], 64, 32 * 6, 18)
draw_item_name(@data[7], 64, 32 * 7, 18)
end
end
#--------------------------------------------------------------------------
# ● 刷新帮助文本
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
#--------------------------------------------------------------------------
# ● 更新光标举行
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# ● 更新光标举行
#--------------------------------------------------------------------------
def update_cursor_rect
# 光标位置不满 0 的情况下
if @index < 0
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 = self.width / @column_max - 32
# 计算光标坐标
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 40 - self.oy
# 更新国标矩形
self.cursor_rect.set(x, y, cursor_width, 40)
end
#end
##############################################################################
class Window_Equip_heads < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor = 0)
#super(160, 48, 240, 352)
super(0, 0, 150,230)
self.windowskin = RPG::Cache.windowskin("../system/menu/windowskins/palskin")
self.opacity = 0
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
name = @actor.name+"_装备头像.png"
bitmap = Bitmap.new("Graphics/System/menu/heads/#{name}")
src_rect = Rect.new(0, 0, 150, 150)
self.contents.blt(0, 0, bitmap, src_rect)
self.contents.font.size = 18
self.contents.font.color = text_color(3)
draw_actor_name(@actor, 0, 173)
end
end[/code][/code][/code]
draw_item_name(@data[0], 64, 32 * 0, 18)就是这一句了。 |
|