Encore un menu, deux héros
Ven 27 Juin 2008 - 12:37
Suite a une commande, une petite création !
nécessite les images :
Pour deux personnages seulement
chacune de dimensions 96*96
a placer dans le dossier system de votre projet
nécessite les images :
- objets.png
skill.png
equip.png
statut.png
quitter.png
Pour deux personnages seulement
chacune de dimensions 96*96
a placer dans le dossier system de votre projet
- Code:
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Scene_Menu par berka Rgss2
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# a coller au dessus de main
# les images ci dessous devront etre placées
# dans le dossier system du dossier graphics du projet
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#===============================================================
#
# rpgmakervx.1fr1.net
#
#===============================================================
Objet = "objets.png"
Skill = "skill.png"
Equip = "equip.png"
Statut = "statut.png"
Quitter = "quitter.png"
class Scene_Menu < Scene_Base
def initialize(menu_index = 0)
menu_index = 0 if menu_index < 0 && menu_index > 4
@menu_index = menu_index
end
def main
@spriteset = Spriteset_Map.new
@index = [
Window_Obj.new, Window_Tec.new, Window_Equ.new, Window_Sta.new,
Window_Qui.new, Window_Pie.new, Window_Tem.new, Window_Her1.new,
Window_Her2.new]
for i in @index; i.opacity = 200; i.active = false; end
@index[@menu_index].active = true
Graphics.transition
loop do
Input.update
Graphics.update
update
break if $scene != self
end
Graphics.freeze
for i in @index; i.dispose; end
@spriteset.dispose
end
def update
for i in @index
if i.active; i.opacity = 100; else; i.opacity = 200; end
i.update
end
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
end
if Input.trigger?(Input.dir4)
case Input.dir4
when 4
if @index[0].active; @index[4].active = true; @index[0].active = false; return; end
if @index[1].active; @index[0].active = true; @index[1].active = false; return; end
if @index[2].active; @index[1].active = true; @index[2].active = false; return; end
if @index[3].active; @index[2].active = true; @index[3].active = false; return; end
if @index[4].active; @index[3].active = true; @index[4].active = false; return; end
when 6
if @index[0].active; @index[1].active = true; @index[0].active = false; return; end
if @index[1].active; @index[2].active = true; @index[1].active = false; return; end
if @index[2].active; @index[3].active = true; @index[2].active = false; return; end
if @index[3].active; @index[4].active = true; @index[3].active = false; return; end
if @index[4].active; @index[0].active = true; @index[4].active = false; return; end
end
end
if Input.trigger?(Input::C)
Sound.play_decision
$scene = Scene_Item.new if @index[0].active
$scene = Scene_Skill.new if @index[1].active
$scene = Scene_Equip.new if @index[2].active
$scene = Scene_Status.new if @index[3].active
$scene = Scene_End.new if @index[4].active
end
end
end
class Window_Obj < Window_Base
def initialize
super(0,0,136, 208)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0 + WLH * 0, 180, WLH, "Objets")
bitmap = Cache.system(Objet)
self.contents.blt(4, 40, bitmap, Rect.new(0, 0, 96, 96), 255)
end
end
class Window_Tec < Window_Base
def initialize
super(136,0,136, 208)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0 + WLH * 0, 180, WLH, "Techniques")
bitmap = Cache.system(Skill)
self.contents.blt(4, 40, bitmap, Rect.new(0, 0, 96, 96), 255)
end
end
class Window_Equ < Window_Base
def initialize
super(136*2,0,136, 208)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0 + WLH * 0, 180, WLH, "Equiper")
bitmap = Cache.system(Equip)
self.contents.blt(4, 40, bitmap, Rect.new(0, 0, 96, 96), 255)
end
end
class Window_Sta < Window_Base
def initialize
super(0,208,136, 208)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0 + WLH * 0, 180, WLH, "Statut")
bitmap = Cache.system(Statut)
self.contents.blt(4, 40, bitmap, Rect.new(0, 0, 96, 96), 255)
end
end
class Window_Qui < Window_Base
def initialize
super(136,208,136, 208)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0 + WLH * 0, 180, WLH, "Quitter")
bitmap = Cache.system(Quitter)
self.contents.blt(4, 40, bitmap, Rect.new(0, 0, 96, 96), 255)
end
end
class Window_Pie < Window_Base
def initialize
super(136*2,208,136, 104)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0 + WLH * 0, 180, WLH, "Pieces")
draw_currency_value($game_party.gold, 4, 32, 120)
end
end
class Window_Tem < Window_Base
def initialize
super(136*2,312,136, 104)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0 + WLH * 0, 180, WLH, "Temps")
@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(24, 32, 120, 32, text, 0)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
class Window_Her1 < Window_Base
def initialize
super(136*3,0,136, 208)
refresh
end
def refresh
self.contents.clear
actor = $game_party.members[0]
self.contents.draw_text(0, 0 + WLH * 0, 180, WLH, actor.name)
draw_actor_level(actor, 50, 18)
draw_actor_face(actor, 8, 40)
draw_actor_hp(actor, 0, 100 + WLH * 1, 100)
draw_actor_mp(actor, 0, 100 + WLH * 2, 100)
end
end
class Window_Her2 < Window_Base
def initialize
super(136*3,208,136, 208)
refresh
end
def refresh
self.contents.clear
actor = $game_party.members[1]
self.contents.draw_text(0, 0 + WLH * 0, 180, WLH, actor.name)
draw_actor_level(actor, 50, 18)
draw_actor_face(actor, 8, 40)
draw_actor_hp(actor, 0, 100 + WLH * 1, 100)
draw_actor_mp(actor, 0, 100 + WLH * 2, 100)
end
end
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum