Kosodu Ressources Finder
Messages : 69 Date d'inscription : 23/03/2008 Localisation : France
| Sujet: Menu A-RPG Lun 24 Mar - 11:44 | |
| Un menu style arpg. Tout dabord changer le Script scene menu par celui ci : Scene_MenuPuis le scrîpt Window_Gold par ceci : - Code:
-
#============================================================================== # ■ Window_Gold #------------------------------------------------------------------------------ # ゴールドを表示するウィンドウです。 #============================================================================== class Window_Gold < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(4, 0, 130, 32, $data_system.words.gold) end end Et le scrîpt Window_PlayTime par ce script : - Code:
-
#============================================================================== # ■ Window_PlayTime #------------------------------------------------------------------------------ # メニュー画面でプレイ時間を表示するウィンドウです。 #============================================================================== class Window_PlayTime < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 130, 32, "Temps de jeu :") @total_sec = Graphics.frame_count / Graphics.frame_rate hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 text = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, text, 2) end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end Window_Steps par ce script : - Code:
-
#============================================================================== # ■ Window_Steps #------------------------------------------------------------------------------ # メニュー画面で歩数を表示するウィンドウです。 #============================================================================== class Window_Steps < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.opacity = 255 refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = system_color self.contents.draw_text(4, 0, 130, 32, "Nombre de pas") self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32, $game_party.steps.to_s, 2) self.opacity = 255 end end Le scrîpt Window_MenuStatus : - Code:
-
#============================================================================== # ■ Window_MenuStatus #------------------------------------------------------------------------------ # メニュー画面でパーティメンバーのステータスを表示するウィンドウです。 #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize super(0, 0, 180, 130) 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_graphic(actor, x - 40, y + 70) draw_actor_name(actor, x, y + 20) self.contents.draw_text(x-55, 42, 120, 32, $game_variables[1].to_s, 2) self.contents.draw_text(x-75, 42, 120, 32, "PV : ", 2) 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 end Ensuite il vous faudra créer une variable des HP du héros et entrer son ID dans les crochets de cette ligne-ci du script ci-dessus : - Code:
-
self.contents.draw_text(x-55, 42, 120, 32, $game_variables[1].to_s, 2) Ici entre crochets il y a "1" ce qui signifie que c'est la première variable, changer ce nombre par l'ID de votre variable. | |
|
Bibix4ever Admin
Messages : 46 Date d'inscription : 23/03/2008
| Sujet: Re: Menu A-RPG Lun 24 Mar - 12:22 | |
| Il est tres bien,je le connaissait pas. | |
|