class Window_kg_status < Window_Base class Sprite_Character < RPG::Sprite #我方 def initialize(actor_id, window_index) super(540 - window_index * 76 , 540, 117, 190) @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], 1, 110) draw_actor_sp($game_actors[@actor_id], 134, 135) draw_actor_cp($game_actors[@actor_id], 134, 160) end 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
队标id.png (651.41 KB, 下载次数: 7)
完成.png (220.89 KB, 下载次数: 4)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |