Project1
标题: 怎么在装备界面显示其他角色属性 [打印本页]
作者: 六翼恶魔 时间: 2012-6-10 21:01
标题: 怎么在装备界面显示其他角色属性
我已经把装备界面排好版了,我试着将Window_MenuStatus内容复制到Window_EquipLeft中,但是后面的内容就会覆盖到前面的东西,我想让主角,和后两个角色显示的内容不一样,应该怎么改呢? 比如说主角显示hp sp exp等等 而其他角色只显示力量 魔力 速度 等这种属性即可,不需要在显示hp sp exp了- #==============================================================================
- # ■ Window_EquipLeft
- #------------------------------------------------------------------------------
- # 装备画面的、显示角色能力值变化的窗口。
- #==============================================================================
- class Window_EquipLeft < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 0, 272, 480)#★★★★★★★★★★★★★★★★
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_name(@actor, 4, 0)
- draw_actor_level(@actor, 4, 32)
- draw_actor_parameter(@actor, 4, 64, 0)
- draw_actor_parameter(@actor, 4, 96, 1)
- draw_actor_parameter(@actor, 4, 128, 2)
- if @new_atk != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 64, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
- end
- if @new_pdef != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 96, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
- end
- if @new_mdef != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 128, 40, 32, "→", 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
- end
- #######################################################
- # def refresh
- # self.contents.clear
- # @item_max = $game_party.actors.size
- # for i in 1...$game_party.actors.size
- # x = 64
- # y = i * 116
- #actor = $game_party.actors[i]
- #draw_actor_graphic(actor, x - 40, y + 80)
- #draw_actor_name(actor, x-50, y)
- # draw_actor_class(actor, x + 144, y)
- # draw_actor_level(actor, x, y + 32)
- # draw_actor_state(actor, x + 90, y + 32)
- #draw_actor_exp(actor, x, y + 64)
- #draw_actor_hp(actor, x + 236, y + 32)
- #draw_actor_sp(actor, x + 236, y + 64)
- # end
- # end
- ##################################################
- end
- #--------------------------------------------------------------------------
- # ● 变更装备后的能力值设置
- # new_atk : 变更装备后的攻击力
- # new_pdef : 变更装备后的物理防御
- # new_mdef : 变更装备后的魔法防御
- #--------------------------------------------------------------------------
- def set_new_parameters(new_atk, new_pdef, new_mdef)
- if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
- @new_atk = new_atk
- @new_pdef = new_pdef
- @new_mdef = new_mdef
- refresh
- end
- end
- end
复制代码