Project1
标题: 请问怎么修改Window_Status脚本使它能显示角色说明? [打印本页]
作者: zphyp120 时间: 2011-8-3 17:28
标题: 请问怎么修改Window_Status脚本使它能显示角色说明?
本帖最后由 zphyp120 于 2011-8-3 17:29 编辑
我把原脚本修改成了这样:(因为人物半身像太矮,又在左上角,所以我想在左下角添加一个角色说明)- class Window_Status < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 0, 640, 480)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...1
- actor = $game_party.actors[i]
- case i
- when 0
- self.contents.draw_text(259, 399, 80, 32, "XXXXXXXXXXXXXXXXXXXXXXXXXX")
-
- self.contents.clear
- bustname = @actor.id.to_s + "_b"
- bitmap=Bitmap.new("Graphics/pictures/#{bustname}")
- src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
- self.contents.blt(0, 0, bitmap, src_rect)
-
- draw_actor_name(@actor, 260, 0)
- draw_actor_class(@actor, 360, 32)
- draw_actor_level(@actor, 260, 32)
- draw_actor_state(@actor, 380, 0)
- draw_actor_hp(@actor, 260, 64, 172)
- draw_actor_sp(@actor, 260, 96, 172)
- draw_actor_parameter(@actor, 440, 66, 0)
- draw_actor_parameter(@actor, 440, 96, 1)
- draw_actor_parameter(@actor, 440, 130, 2)
- draw_actor_parameter(@actor, 260, 162, 3)
- draw_actor_parameter(@actor, 260, 194, 4)
- draw_actor_parameter(@actor, 440, 162, 5)
- draw_actor_parameter(@actor, 440, 194, 6)
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(259, 399, 80, 32, "EXP")
- self.contents.draw_text(439, 399, 80, 32, "NEXT")
- self.contents.font.color = normal_color
- self.contents.draw_text(260 + 80, 400, 84, 32, @actor.exp_s, 2)
- self.contents.draw_text(440 + 80, 400, 84, 32, @actor.next_rest_exp_s, 2)
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(260, 240, 96, 32, "装备")
- draw_item_name($data_weapons[@actor.weapon_id], 260, 270)
- draw_item_name($data_armors[@actor.armor1_id], 420, 270)
- draw_item_name($data_armors[@actor.armor2_id], 260, 310)
- draw_item_name($data_armors[@actor.armor3_id], 420, 310)
- draw_item_name($data_armors[@actor.armor4_id], 260, 350)
- end
- end
- end
- end
复制代码 我的想法就是用case语句来判断角色显示不同角色的人物说明。