| Ancien membre du staff |
 |
 |
Inscrit le: 24 Juin 2008, 00:00 Messages: 476 Logiciel(s) préféré(s): Scintilla based Point(s) Fort(s): Rubyismes Points d'aide: 60/60
Créations :
- [Rmxp] Vocab
- [Rmxp] Visible Equipment
- [Rmxp] Animated Title
- [XP/VX] Cache Extension
Voir ses créations
|
Window_MenuStatus- Code: Tout sélectionner
#========================================================= # ■ Window_MenuStatus #------------------------------------------------------ # メニュー画面でパーティメンバーのステータスを表示するウィンドウです。 #=========================================================
class Window_MenuStatus < Window_Selectable #------------------------------------------------ # ● オブジェクト初期化 #------------------------------------------------ def initialize super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh self.active = false self.index = -1 end #------------------------------------------------ # ● リフレッシュ #------------------------------------------------ def refresh self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 64 y = i * 116 actor = $game_party.actors[i] draw_actor_name(actor, x, y) draw_actor_barz(actor,100, 100, "horizontal", 150, 20, actor.hp,actor.maxhp, Color.new(73,22,14,255), Color.new(194,64,13,255)) draw_actor_barz(actor,100, 133, "horizontal", 150, 20, actor.sp,actor.maxsp, Color.new(22,14,73,255), Color.new(64,13,194,255)) draw_actor_level(actor, x, y + 32) draw_actor_state(actor, x + 96, y) draw_actor_exp(actor, x, y + 64) draw_actor_hp(actor, x , y + 96) draw_actor_sp(actor, x , y + 128) end end #------------------------------------------------ # ● カーソルの矩形更新 #------------------------------------------------ def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 116, self.width - 32,96) end end #------------------------------------------------ def draw_actor_name(actor, x, y) self.contents.font.color = Color.new(101,54,36,255) self.contents.font.size=30 self.contents.draw_text(x, y, 120, 32, actor.name) end #------------------------------------------------ def draw_actor_level(actor, x, y) self.contents.font.size= 20 self.contents.font.color = Color.new(101,54,36,255) self.contents.draw_text(x, y, 32, 32, "Lvl") self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2) end #------------------------------------------------ def draw_actor_state(actor, x, y, width = 120) text = make_battler_state_text(actor, width, true) self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color self.contents.font.color = Color.new(101,54,36,255) self.contents.draw_text(x, y, width, 32, text) end #------------------------------------------------ def draw_actor_exp(actor, x, y) self.contents.font.size = 20 self.contents.font.color = Color.new(101,54,36,255) self.contents.draw_text(x, y, 32, 32, "Exp") self.contents.draw_text(x + 24, y, 84, 32, actor.exp_s, 2) self.contents.draw_text(x + 108, y, 12, 32, "/", 1) self.contents.draw_text(x + 120, y, 84, 32, actor.next_exp_s) end #------------------------------------------------ def draw_actor_hp(actor, x, y, width = 144) # 文字列 "HP" を描画 self.contents.font.color = Color.new(101,54,36,255) self.contents.draw_text(x, y, 32, 32, $data_system.words.hp) # MaxHP を描画するスペースがあるか計算 if width - 32 >= 108 hp_x = x + width - 108 flag = true elsif width - 32 >= 48 hp_x = x + width - 48 flag = false end # HP を描画 self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color self.contents.font.color = Color.new(255,245,233,255) self.contents.draw_text(hp_x+20, y, 48, 32, actor.hp.to_s, 2) # MaxHP を描画 if flag self.contents.font.color = Color.new(255,245,233,255) self.contents.draw_text(hp_x + 68, y, 12, 32, "/", 1) self.contents.draw_text(hp_x + 80, y, 48, 32, actor.maxhp.to_s) end end #------------------------------------------------ def draw_actor_sp(actor, x, y, width = 144) # 文字列 "SP" を描画 self.contents.font.color = Color.new(101,54,36,255) self.contents.draw_text(x, y, 32, 32, $data_system.words.sp) # MaxSP を描画するスペースがあるか計算 if width - 32 >= 108 sp_x = x + width - 108 flag = true elsif width - 32 >= 48 sp_x = x + width - 48 flag = false end # SP を描画 self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color self.contents.font.color = Color.new(255,245,233,255) self.contents.draw_text(sp_x+20, y, 48, 32, actor.sp.to_s, 2) # MaxSP を描画 if flag self.contents.draw_text(sp_x + 68, y, 12, 32, "/", 1) self.contents.draw_text(sp_x + 80, y, 48, 32, actor.maxsp.to_s) end end #------------------------------------------------ end
|
|