Jump to content
Rpg²S Forum
  • 0

Switch che fa sparire l'HUD


nihil-omen
 Share

Question

Allora, come già scritto precedentemente ho pesantemente modificato l'HUD HP/MP/EXP/GOLD che c'è sul forum ed oggi sono riuscito ad aggiungere una switch che quando la si attiva fa apparire l'HUD.

 

Solo che vorrei fare che quando si disattiva l'HUD sparisce, invece rimane lì finchè non si apre il menù (o si cambia mappa penso, insomma finchè non fa un refresh totale la mappa).

 

Come faccio a far si che spariscano tutte le scritte, le picture, le barre? é___è

 

Help *O*

http://i30.tinypic.com/xehois.gif

} 2rA - web site {

E' disponibile il primo capitolo completo di 2rA!

} 2rA: Capitolo I {

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

Io avevo lo stesso problema ma ho risolto tramite script... Creo una window dove inserisco le def draw_actor che mi interessano poi vado in scene_map e faccio apparire la nuova finestra adesso nel def update inserisco

  if Input.trigger?(Input::Y)	   @message_finestra.visible = !@message_finestra.visible

In questo modo alla pressione di S(y) appare e scompare l'hud prova a sostituire input con una game_switch per vedere se funziona.

http://img256.imageshack.us/img256/7639/ihateyou.gif

Un uomo senza religione è come un pesce senza bicicletta.

http://img18.imageshack.us/img18/3668/decasoft1.png

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif

Link to comment
Share on other sites

  • 0
Se mi passi il link ti posso aiutare altrimenti ho grossi problemi.

http://img256.imageshack.us/img256/7639/ihateyou.gif

Un uomo senza religione è come un pesce senza bicicletta.

http://img18.imageshack.us/img18/3668/decasoft1.png

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif

Link to comment
Share on other sites

  • 0

Uh dunque.... Prova così:

Setta la propietà visible di tutti gli elementi (all'intenro del ciclo main) così:

elemento.visible=$game_switches[num]

Dove num è il numero della switch

"Fight for honor, fight for your life. Pray to god that our side is right.

-Avenged sevenfold M.I.A.

 

http://mypsn.eu.playstation.com/psn/profile/Black_Serian.png

Link to comment
Share on other sites

  • 0

Black intendi di settare quella cosa per ogni elemento? No perchè c'è tanta roba XD

 

Vi posto lo script, perchè c'ho aggiunto un fottio di cose >__<

 

#=============================================================# ** Game_Actor# Script by MeisMe# Graphics added by Peaches# Icons made by Joshie666 & Axerax#------------------------------------------------------------------------------# This class handles the actor. It's used within the Game_Actors class# ($game_actors) and refers to the Game_Party class ($game_party).#==============================================================================class Game_Actor#--------------------------------------------------------------------------# * Get the current EXP#--------------------------------------------------------------------------def now_expreturn @exp - @exp_list[@level]end#--------------------------------------------------------------------------# * Get the next level's EXP#--------------------------------------------------------------------------def next_expreturn @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0endend #==============================================================================# ** Window_HUD#------------------------------------------------------------------------------# This class is used to display HP, SP and Gold on the map.#==============================================================================class Window_HUD < Window_Base#--------------------------------------------------------------------------# * Object Initialization#--------------------------------------------------------------------------def initializesuper(-16, -16, 672, 672)self.contents = Bitmap.new(width-32, height-32)self.opacity = 0self.contents.font.size = 14self.contents.font.name = "Arial"@actors = []@old_hp = []@old_sp = []@old_exp = []@old_level = []for i in 0...$game_party.actors.size@actors.push($game_party.actors[i])@old_hp.push(@actors[i].hp)@old_hp.push(@actors[i].maxhp)@old_sp.push(@actors[i].sp)@old_exp.push(@actors[i].now_exp)@old_level.push(@actors[i].level)end@old_gold = $game_party.gold@old_ammo = $game_variables[9]  if $game_party.actors[0].weapon_id == 20	@old_variabile_lancio = $game_party.weapon_number(20) + 1  end  if $game_party.actors[0].weapon_id == 21	@old_variabile_lancio = $game_party.weapon_number(21) + 1  end  if $game_party.actors[0].weapon_id == 22	@old_variabile_lancio = $game_party.weapon_number(22) + 1  end  if $game_party.actors[0].weapon_id == 23	@old_variabile_lancio = $game_party.weapon_number(23) + 1  end  if $game_party.actors[0].weapon_id == 24	@old_variabile_lancio = $game_party.weapon_number(24) + 1  end@old_ESP = $game_variables[16]@old_ESPmax = $game_variables[15]@old_switch = $game_switches[67]refreshend#--------------------------------------------------------------------------# * Refresh#--------------------------------------------------------------------------def refresh  if $game_switches[67]self.contents.clearself.contents.font.color = system_color#self.contents.draw_text(6, 0, 32, 14, $data_system.words.hp + "")#self.contents.draw_text(6, 14, 32, 14, $data_system.words.sp + "")self.contents.draw_text(6, 28, 32, 14, "")#self.contents.draw_text(6, 42, 32, 14, $data_system.words.gold + "")self.contents.font.color = normal_color#Images   bitmap = RPG::Cache.picture("TO_HUD")self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 176, 64))  x = 40for i in 0...@actors.sizey = 6 self.contents.font.color = system_colorself.contents.draw_text(x, y, 110, 14, "Hp: ")##{@actors[i].hp} / #{@actors[i].maxhp}")self.contents.draw_text(x-16, y, 110, 14, "Act: ", 2)##{@actors[i].sp}", 2) #self.contents.font.color = normal_colorself.contents.draw_text(x + 7, y, 110, 14, "	#{@actors[i].hp} / #{@actors[i].maxhp}")self.contents.draw_text(x, y, 110, 14, "	#{@actors[i].sp}", 2)y += 16 draw_hp_bar(@actors[i], x, y, 112, 3)y += 10draw_sp_bar(@actors[i], x, y, 112, 3)y += 5	  case $game_party.actors[0].weapon_id	  when 1		bitmap = RPG::Cache.icon("W - 01 -Coltello")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))	  when 2		bitmap = RPG::Cache.icon("W - 02 -Spranga")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))	  when 3		bitmap = RPG::Cache.icon("W - 03 -Katana")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))	  when 4		bitmap = RPG::Cache.icon("W - 04 -Alabarda")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))	  when 5		bitmap = RPG::Cache.icon("W - 05 -Excalibur")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))	  when 6		bitmap = RPG::Cache.icon("W - 06 -Pistola")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 01 -Proiettili 9mm")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[126]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 7		bitmap = RPG::Cache.icon("W - 07 -Beretta")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 01 -Proiettili 9mm")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[127]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 8		bitmap = RPG::Cache.icon("W - 08 -Blacktail")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 01 -Proiettili 9mm")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[128]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 9		bitmap = RPG::Cache.icon("W - 09 -Fucile Da Caccia")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 02 -Cartucce Calibro 12")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[129]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 10		bitmap = RPG::Cache.icon("W - 10 -Doppietta")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 02 -Cartucce Calibro 12")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[130]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 11		bitmap = RPG::Cache.icon("W - 11 -Fucile Antisommossa")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 02 -Cartucce Calibro 12")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[131]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 12		bitmap = RPG::Cache.icon("W - 12 -Fucile Di Precisione")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 04 -Proiettili Calibro 223")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[132]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 13		bitmap = RPG::Cache.icon("W - 13 -Mitraglietta")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 03 -Proiettili 5,56mm")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[133]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 14		bitmap = RPG::Cache.icon("W - 14 -Gatling Gun")		self.contents.blt(x - 28, y - 22, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 03 -Proiettili 5,56mm")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[134]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 15		bitmap = RPG::Cache.icon("W - 15 -Magnum")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 05 -44 Magnum")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[135]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 16		bitmap = RPG::Cache.icon("W - 16 -Alchemist Colt")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		  if $game_variables[137] == 1			bitmap = RPG::Cache.icon("B - 06 -Proiettile d'Argento")			self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		  elsif $game_variables[137] == 2			bitmap = RPG::Cache.icon("B - 07 -Proiettile d'Oro")			self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		  elsif $game_variables[137] == 3			bitmap = RPG::Cache.icon("B - 08 -Proiettile al Fosforo")			self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		  end		$game_variables[9] = $game_variables[136]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 17		bitmap = RPG::Cache.icon("W - 17 -Lancia Granate")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 09 -Munizioni Granate")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[138]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 18		bitmap = RPG::Cache.icon("W - 18 -Lanciafiamme")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 10 -Combustibile Lanciafiamme")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[139]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 19		bitmap = RPG::Cache.icon("W - 19 -Lanciarazzi")		self.contents.blt(x - 28, y - 22, bitmap, Rect.new(0, 0, 24, 24))		bitmap = RPG::Cache.icon("B - 11 -Razzo")		self.contents.blt(x - 28, y, bitmap, Rect.new(0, 0, 24, 24))		$game_variables[9] = $game_variables[140]		  self.contents.draw_text(x , y - 5, 120, 32, $game_variables[9].to_s + "/" )		  self.contents.draw_text(x , y - 5, 36, 32, $game_party.actors[0].str.to_s , 2)	  when 20		bitmap = RPG::Cache.icon("W - 20 -Molotov")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		  variabile_lancio = $game_party.weapon_number(20) + 1		  self.contents.draw_text(x , y, 36, 32, variabile_lancio.to_s )	  when 21		bitmap = RPG::Cache.icon("W - 21 -Granata Esplosiva")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		  variabile_lancio = $game_party.weapon_number(21) + 1		  self.contents.draw_text(x , y, 36, 32, variabile_lancio.to_s )	  when 22		bitmap = RPG::Cache.icon("W - 22 -Granata Incendiaria")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		  variabile_lancio = $game_party.weapon_number(22) + 1		  self.contents.draw_text(x , y, 36, 32, variabile_lancio.to_s )	  when 23		bitmap = RPG::Cache.icon("W - 23 -Granata Accecante")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		  variabile_lancio = $game_party.weapon_number(23) + 1		  self.contents.draw_text(x , y, 36, 32, variabile_lancio.to_s )	  when 24		bitmap = RPG::Cache.icon("W - 24 -Granata Acida")		self.contents.blt(x - 28, y - 20, bitmap, Rect.new(0, 0, 24, 24))		  variabile_lancio = $game_party.weapon_number(24) + 1		  self.contents.draw_text(x , y, 36, 32, variabile_lancio.to_s )	  end	if $game_variables[15] >= 1	  self.contents.font.color = system_color	  self.contents.draw_text(x + 40 , y - 5, 48, 32, "ESP ",2)		  self.contents.font.color = normal_color			self.contents.draw_text(x + 55 , y - 5, 48, 32, $game_variables[16].to_s, 2)		  self.contents.font.color = normal_color			self.contents.draw_text(x + 70, y - 5, 48, 32, "/" + $game_variables[15].to_s, 2)	end y -= 30y += 16y += 19x += 130endx = 32  end#self.contents.draw_text(45, 73, 110, 14, $game_party.gold.to_s)end#--------------------------------------------------------------------------# * Frame Update#--------------------------------------------------------------------------def updatesuperif @actors.size != $game_party.actors.size@actors = []for i in 0...$game_party.actors.size@actors.push($game_party.actors[i])endrefreshreturnendfor i in 0...@actors.sizeif @old_hp[i] != @actors[i].hp or@old_sp[i] != @actors[i].sp or@old_exp[i] != @actors[i].now_exp or@old_level[i] != @actors[i].level or@old_gold != $game_party.gold or@old_ammo != $game_variables[9] or@old_ESP != $game_variables[16] or@old_ESPmax != $game_variables[15] or@old_switch != $game_switches[67] or  if $game_party.actors[0].weapon_id == 20	@old_variabile_lancio != $game_party.weapon_number(20) + 1  end  if $game_party.actors[0].weapon_id == 21	@old_variabile_lancio != $game_party.weapon_number(21) + 1  end  if $game_party.actors[0].weapon_id == 22	@old_variabile_lancio != $game_party.weapon_number(22) + 1  end  if $game_party.actors[0].weapon_id == 23	@old_variabile_lancio != $game_party.weapon_number(23) + 1  end  if $game_party.actors[0].weapon_id == 24	@old_variabile_lancio != $game_party.weapon_number(24) + 1  endrefresh@old_hp[i] = @actors[i].hp@old_sp[i] = @actors[i].sp@old_exp[i] = @actors[i].now_exp@old_level[i] = @actors[i].level@old_gold = $game_party.gold@old_ammo = $game_variables[9]@old_ESP = $game_variables[16]@old_ESPmax = $game_variables[15]@old_switch != $game_switches[67]  if $game_party.actors[0].weapon_id == 20	@old_variabile_lancio = $game_party.weapon_number(20) + 1  end  if $game_party.actors[0].weapon_id == 21	@old_variabile_lancio = $game_party.weapon_number(21) + 1  end  if $game_party.actors[0].weapon_id == 22	@old_variabile_lancio = $game_party.weapon_number(22) + 1  end  if $game_party.actors[0].weapon_id == 23	@old_variabile_lancio = $game_party.weapon_number(23) + 1  end  if $game_party.actors[0].weapon_id == 24	@old_variabile_lancio = $game_party.weapon_number(24) + 1  endendendend#==========================================# Aggiungere queste due istruzioni#end class Window_Base < Window## Fine delle aggiunte#==========================================#--------------------------------------------------------------------------# * Draw HP Bar#--------------------------------------------------------------------------def draw_hp_bar(actor, x, y, length, thick)width = lengthheight = thickc1 = Color.new(0, 170, 160)c2 = Color.new(0, 110, 100)e1 = actor.hpe2 = actor.maxhpself.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))w = width * e1 / e2for i in 0..heightr = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/heightg = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/heightb = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/heighta = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/heightself.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))endend#--------------------------------------------------------------------------# * Draw SP Bar#--------------------------------------------------------------------------def draw_sp_bar(actor, x, y, length, thick)width = lengthheight = thickc1 = Color.new(150, 130, 0)c2 = Color.new(90, 70, 0)e1 = actor.spe2 = actor.maxspself.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255))self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0))w = width * e1 / e2for i in 0..heightr = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/heightg = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/heightb = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/heighta = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/heightself.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))endend #==============================================================================# ** Scene_Map#------------------------------------------------------------------------------# This class performs map screen processing.#==============================================================================class Scene_Map#--------------------------------------------------------------------------# * Object Aliasing#--------------------------------------------------------------------------alias hud_scene_map_main mainalias hud_scene_map_update update#--------------------------------------------------------------------------# * Object Initialization#--------------------------------------------------------------------------def main@HUD = Window_HUD.newhud_scene_map_main@HUD.disposeend#--------------------------------------------------------------------------# * Frame Update#--------------------------------------------------------------------------def update@HUD.updatehud_scene_map_updateendend

 

 

EDIT: l'ho ripulito da un po' di cose inutili :D

http://i30.tinypic.com/xehois.gif

} 2rA - web site {

E' disponibile il primo capitolo completo di 2rA!

} 2rA: Capitolo I {

Link to comment
Share on other sites

  • 0

Window_HUD questo è il nome della finestra , come sospettavo alla fine richiama la scene_map per mostrare la Window_hud all'interno della scena.

comunque basta scrivere

if game_switch[1]

@HUD.visible=!@HUD.visible

end

 

nel def update alla fine del tuo script.

http://img256.imageshack.us/img256/7639/ihateyou.gif

Un uomo senza religione è come un pesce senza bicicletta.

http://img18.imageshack.us/img18/3668/decasoft1.png

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif

Link to comment
Share on other sites

  • 0

oppure... te dove l'hai settata l'HUD?

perchè se tutte le immagini e i dati sovrapposti dell'HUD li metti in una baseclass di window_base... poi puoi richiamarla come nuova window quando stai sullo scene_map ed hai fatto =D

a quel punto se hai lo script così:

 

Window_hud < Window_Base

inizialize

back= Sprite.new

back.bitmap = RPG::Chace.pictures("Immagine.png")

self.contents.set_text(x,y,width,heigth,"testo",1)

end

refresh

self.contents.clear

[ariscrivi tutto]

end

update

[...]

end

[ecc ecc...]

end

 

poi nella SceneMap metti il comando

@window_hud = Window_hud.new

[all'inizio, nell'inizialize]

@window_hud.dispose

[dopo il do-loop e il refresh]

@window_hud.update

[dove stanno gli altri update... all'inizio del metodo update]

 

Ricordati che il refresh l'update e l'inizialize devono essere definiti nella classe Window_hud... altrimenti non ti fungerà nulla :\

a quel punto puoi mettere il comando che ti ha dato master_sion U.U

 

EDIT: scusa... quando stavo scrivendo il post gli ultimi 2 ancora non c'erano...

e allora non hai problemi scusa o_o

la condizione sulla visible devi metterla nello Scene_Map... non da altre parti :\ è un attimo U.U

controlli la switch (se non vuoi usare la switch usa una var universale, es: $hud) e come condizione ci metti @hud.visible = true e @hud.visible = false...

Edited by FenriX`

 

 

Membro # 8-8-8 [Hachi] della:

http://img3.imageshack.us/img3/9636/bannergm.png

Link to comment
Share on other sites

  • 0
In generale questi scritp non mi piacciono per niente preferisco crearlo da solo (anche perchè riscrivono sempre qualche scena).

http://img256.imageshack.us/img256/7639/ihateyou.gif

Un uomo senza religione è come un pesce senza bicicletta.

http://img18.imageshack.us/img18/3668/decasoft1.png

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif

Link to comment
Share on other sites

  • 0

Ok :D Non credo di aver capito :D

 

if game_switch[1]

@HUD.visible=!@HUD.visible

end

 

Ho provato a metterlo alla fine del def update ma non funge ò_o Come dovrei metterlo?

 

la condizione sulla visible devi metterla nello Scene_Map... non da altre parti :\ è un attimo U.U

controlli la switch (se non vuoi usare la switch usa una var universale, es: $hud) e come condizione ci metti @hud.visible = true e @hud.visible = false...

 

Qui non ho capito un granchè :D Per Scene_Map intendi la porzione di Scene_Map di questo script oppure lo Scene_Map di base?

E come dovrei mettere precisamente la condizione?

 

PS: Io sono ancora un niubbone con il ruby *___* L'unica cosa che sò fare sono i calcoli tra variabili e (a volte) visualizzare qualche immagine/stringa :D

Per il resto brancolo nel buio :D

 

In ogni caso grazie mille per l'aiuto e per la pazienza *O*

http://i30.tinypic.com/xehois.gif

} 2rA - web site {

E' disponibile il primo capitolo completo di 2rA!

} 2rA: Capitolo I {

Link to comment
Share on other sites

  • 0

#============================================================= # ** Game_Actor# Script by MeisMe# Graphics added by Peaches# Icons made by Joshie666 & Axerax#------------------------------------------------------------------------------# This class handles the actor. It's used within the Game_Actors class# ($game_actors) and refers to the Game_Party class ($game_party).#==============================================================================class Game_Actor#--------------------------------------------------------------------------# * Get the current EXP#--------------------------------------------------------------------------def now_expreturn @exp - @exp_list[@level]end#--------------------------------------------------------------------------# * Get the next level's EXP#--------------------------------------------------------------------------def next_expreturn @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0endend #==============================================================================# ** Window_HUD#------------------------------------------------------------------------------# This class is used to display HP, SP and Gold on the map.#==============================================================================class Window_HUD < Window_Base#--------------------------------------------------------------------------# * Object Initialization#--------------------------------------------------------------------------def initializesuper(-16, -16, 672, 150)self.contents = Bitmap.new(width-32, height-32)self.opacity = 0self.contents.font.size = 14self.contents.font.name = "Arial"@actors = []@old_hp = []@old_sp = []@old_exp = []@old_level = []for i in 0...$game_party.actors.size@actors.push($game_party.actors[i])@old_hp.push(@actors[i].hp)@old_sp.push(@actors[i].sp)@old_exp.push(@actors[i].now_exp)@old_level.push(@actors[i].level)end@old_gold = $game_party.goldrefreshend#--------------------------------------------------------------------------# * Refresh#--------------------------------------------------------------------------def refreshself.contents.clearself.contents.font.color = system_color#self.contents.draw_text(6, 0, 32, 14, $data_system.words.hp + "")#self.contents.draw_text(6, 14, 32, 14, $data_system.words.sp + "")self.contents.draw_text(6, 28, 32, 14, "")#self.contents.draw_text(6, 42, 32, 14, $data_system.words.gold + "")self.contents.font.color = normal_color#Images case @actors.sizewhen 1bitmap = RPG::Cache.picture("HUD Graphic")self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))when 2bitmap = RPG::Cache.picture("HUD Graphic2")self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))when 3bitmap = RPG::Cache.picture("HUD Graphic2")self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))when 4bitmap = RPG::Cache.picture("HUD Graphic3")self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 640, 500))when 5bitmap = RPG::Cache.picture("HUD Graphic3")self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 640, 500))end #bitmap = RPG::Cache.picture("HUD Graphic")#self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))bitmap = RPG::Cache.icon("HP Symbol")self.contents.blt(3, 10, bitmap, Rect.new(0, 0, 24, 24))bitmap = RPG::Cache.icon("SP Symbol")self.contents.blt(3, 30, bitmap, Rect.new(0, 0, 24, 24))bitmap = RPG::Cache.icon("EXP Symbol")self.contents.blt(3, 50, bitmap, Rect.new(0, 0, 24, 24))bitmap = RPG::Cache.icon("Hero")self.contents.blt(25, 67, bitmap, Rect.new(0, 0, 24, 24)) if $game_switches[99] == trueif $game_variables[99] == 0self.contents.draw_text(x, y, 210, 14, $game_party.item_number[1])elsif $game_variables[8] == 1self.contents.draw_text(x, y, 210, 14, $game_party.item_number(2))elsif $game_variables[8] ==2self.contents.draw_text(x, y, 110, 14, @actors[i].name)endendx = 32for i in 0...@actors.sizey = 6self.contents.draw_text(x, y, 110, 14, @actors[i].name)self.contents.draw_text(x, y, 110, 14, "Lv: #{@actors[i].level}", 2)y += 16draw_hp_bar(@actors[i], x, y, 112, 5)y += 19draw_sp_bar(@actors[i], x, y, 104, 5)y += 19draw_exp_bar(@actors[i], x, y, 88, 5)y += 19x += 130endx = 32self.contents.draw_text(45, 73, 110, 14, $game_party.gold.to_s)end#--------------------------------------------------------------------------# * Frame Update#--------------------------------------------------------------------------def updatesuperif @actors.size != $game_party.actors.size@actors = []for i in 0...$game_party.actors.size@actors.push($game_party.actors[i])endrefreshreturnendfor i in 0...@actors.sizeif @old_hp[i] != @actors[i].hp or@old_sp[i] != @actors[i].sp or@old_exp[i] != @actors[i].now_exp or@old_level[i] != @actors[i].level or@old_gold != $game_party.goldrefresh@old_hp[i] = @actors[i].hp@old_sp[i] = @actors[i].sp@old_exp[i] = @actors[i].now_exp@old_level[i] = @actors[i].level@old_gold = $game_party.goldendendend#--------------------------------------------------------------------------# * Draw HP Bar#--------------------------------------------------------------------------def draw_hp_bar(actor, x, y, length, thick)width = lengthheight = thickc1 = Color.new(255, 0, 0)c2 = Color.new(155, 0, 0)e1 = actor.hpe2 = actor.maxhpself.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))w = width * e1 / e2for i in 0..heightr = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/heightg = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/heightb = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/heighta = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/heightself.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))endend#--------------------------------------------------------------------------# * Draw SP Bar#--------------------------------------------------------------------------def draw_sp_bar(actor, x, y, length, thick)width = lengthheight = thickc1 = Color.new(0, 0, 255)c2 = Color.new(0, 0, 155)e1 = actor.spe2 = actor.maxspself.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255))self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0))w = width * e1 / e2for i in 0..heightr = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/heightg = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/heightb = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/heighta = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/heightself.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))endend#--------------------------------------------------------------------------# * Draw EXP Bar#--------------------------------------------------------------------------def draw_exp_bar(actor, x, y, length, thick)width = lengthheight = thickc1 = Color.new(158, 208, 9)c2 = Color.new(58, 108, 0)e1 = actor.now_expe2 = actor.next_expif actor.next_exp == 0e1 = 1e2 = 1endself.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))w = width * e1 / e2for i in 0..heightr = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/heightg = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/heightb = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/heighta = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/heightself.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))endendend #==============================================================================# ** Scene_Map#------------------------------------------------------------------------------# This class performs map screen processing.#==============================================================================class Scene_Map#--------------------------------------------------------------------------# * Object Aliasing#--------------------------------------------------------------------------alias hud_scene_map_main mainalias hud_scene_map_update update#--------------------------------------------------------------------------# * Object Initialization#--------------------------------------------------------------------------def main@HUD = Window_HUD.new@HUD.visible = falsehud_scene_map_main@HUD.disposeend#--------------------------------------------------------------------------# * Frame Update#--------------------------------------------------------------------------def update@HUD.updatehud_scene_map_update if $game_switches[1] == true@HUD.visible = trueelse  @HUD.visible = falseendendend

Tagliamo la testa al toro, incolla questo e guarda la fine del codice la switch è 1 ( adesso l'hud è invisibile devi attivare la switch per renderlo visibile).

Edit : arghh , dimenticato di due end alla fine.

Edited by MasterSion

http://img256.imageshack.us/img256/7639/ihateyou.gif

Un uomo senza religione è come un pesce senza bicicletta.

http://img18.imageshack.us/img18/3668/decasoft1.png

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif

Link to comment
Share on other sites

  • 0
Di niente ^_^, quando ti serve qualcosa di così facile mandami un Pm.

http://img256.imageshack.us/img256/7639/ihateyou.gif

Un uomo senza religione è come un pesce senza bicicletta.

http://img18.imageshack.us/img18/3668/decasoft1.png

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...