class Window_kg_status < Window_Base #我方 def initialize(actor_id, window_index) super(560 - window_index * 76 , 540, 117, 150) @actor_id = actor_id self.contents = Bitmap.new(width - 1, height- 1 ) self.opacity = 0 refresh end def dispose super end def refresh self.contents.clear #draw_actor_name($game_actors[@actor_id], 0, 0) draw_actor_picture($game_actors[@actor_id].battler_name, $game_actors[@actor_id].battler_hue, +1 ,+1) draw_actor_hp($game_actors[@actor_id], 50, 25) draw_actor_sp($game_actors[@actor_id], 134, 50) draw_actor_cp($game_actors[@actor_id], 134, 80) end #敌方 def initialize(enemy_id, window_index) super(640 + window_index * 76 , 540, 117, 150) @enemy_id = enemy_id self.contents = Bitmap.new(width - 1, height- 1 ) self.opacity = 0 refresh end def dispose super end def refresh self.contents.clear #draw_actor_name($game_actors[@actor_id], 0, 0) draw_enemy_picture($game_enemy[@enemy_id].battler_name, $game_enemy[@enemy_id].battler_hue, +1 ,+1) draw_enemy_hp($game_enemy[@enemy_id], 50, 25) draw_enemy_sp($game_enemy[@enemy_id], 134, 50) draw_enemy_cp($game_enemy[@enemy_id], 134, 80) end end #enemy class Window_Base < Window #我方 def draw_actor_cp(actor, x, y, width = 90, height = 15) w = [actor.cp, 100].min / 100 * width self.contents.fill_rect(x, y, width,height,Color.new(0,0,0)) self.contents.fill_rect(x, y + 1 , width,height -2,Color.new(255, 255, 128)) self.contents.fill_rect(x + 1, y + 1, w, height -2,Color.new(255,255,255)) end def draw_actor_picture(actor_name, actor_hue, x, y) bitmap = RPG::Cache.battler(actor_name,actor_hue) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) self.contents.blt(x, y, bitmap, src_rect) end #敌方 def draw_actor_cp(enemy, x, y, width = 90, height = 15) w = [enemy.cp, 100].min / 100 * width self.contents.fill_rect(x, y, width,height,Color.new(0,0,0)) self.contents.fill_rect(x, y + 1 , width,height -2,Color.new(255, 255, 128)) self.contents.fill_rect(x + 1, y + 1, w, height -2,Color.new(255,255,255)) end def draw_enemy_picture(enemy_name, enemy_hue, x, y) bitmap = RPG::Cache.battler(enemy_name,enemy_hue) src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) self.contents.blt(x, y, bitmap, src_rect) end end
右边显示敌人头像.png (1.44 MB, 下载次数: 5)
CP技能.jpg (279.15 KB, 下载次数: 6)
完成.png (220.89 KB, 下载次数: 5)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |