XTonyPL
Preferowany:
Pomógł: 7 razy Dołączył: 01 Cze 2012 Posty: 23
|
Wysłany: Czw 07 Cze, 2012 14:47
|
|
|
W tym skrypcie opcjonalnie można zrobić ,że do każdej chara jest dodawana grafika twarzy.
(obrazki umiesc w Pictures)
Wybierz sobie któryś i nazwij go: "hud" (oczywiście bez "")
- - -
Tu masz podstawową twarz możesz jej użyć lub zmienić ,lecz musi być o takiej samej rozdzielczości.
Nazwij ją: "face"
- - -
Paski Hp/MP/XP:
Nazwij: HP
Nazwij: MP
Nazwij XP
- - -
Skrypt przetłumaczony przeze mnie:
Kod: | #==============================================================================
# ** HUD
#------------------------------------------------------------------------------
# By Marlos Gama
# Przetłumaczył DaviPL ;
#------------------------------------------------------------------------------
class Hud < Window_Base
def initialize
super(-16,-16,500,200)#(320,350,600,600)
self.back_opacity = 120
self.contents = Bitmap.new(lammer - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("Blank")
refresh
end
def update
super
refresh if something_changed?
end
def something_changed?
Jeżeli true to pasek exp jest ON @ old_exp! = @ actor.now_exp
Jeżeli true to pasek HP jest ON @ old_hp! = @ actor.hp
Jeżeli true to pasek SP jest ON @ old_sp! = @ actor.sp
Jeżeli true to pasek LvL jest ON @ old_level! = @ actor.level
Jeżeli true to nazwa gracza jest ON @ Stara_nazwa! = @ actor.name
Jeżeli true to pasek ilości złota jest ON @ Stara_nazwa! = @ old_gold
return false
end
def refresh
self.contents.clear
@actor = $game_party.actors[0]
@old_exp = @actor.now_exp
@old_hp = @actor.hp
@old_sp = @actor.sp
@old_level = @actor.level
@old_name = @actor.name
@old_gold = $game_party.item_number(Item_Ouro::Item_Id.to_i).to_s
self.contents.clear
shud3 = RPG::Cache.picture("Face")
shud1 = shud3.lammer
shud2 = shud3.height
shud4 = Rect.new(0,0,shud1,shud2)
self.contents.blt(15,20,shud3,shud4)
hud3 = RPG::Cache.picture("hud")
hud1 = hud3.lammer
hud2 = hud3.height
hud4 = Rect.new(0,0,hud1,hud2)
self.contents.blt(0,0,hud3,hud4)
self.contents.font.size = 16
rect = Rect.new(-90, 16+1, self.contents.lammer - 8, 32)
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(rect, "#{@old_name}", 1)
self.contents.draw_text(222, 18, 132, 32, "#{@actor.level}")
self.contents.draw_text(120, -5, 132, 32, "#{@old_gold}")
rectc = Rect.new(90, 12+1, self.contents.lammer - 8, 32)
self.contents.font.color = Color.new(0,255,255)
self.contents.draw_text(rectc, "#{@actor.guild}", 1)
# Hp
self.contents.font.color = Color.new(0,0,0)
hpbar = RPG::Cache.picture("HP")
hpbarwidth = hpbar.lammer * @actor.hp / @actor.maxhp
hpbarheight = hpbar.height
hpbar_rect = Rect.new(0,0,hpbarwidth,hpbarheight)
self.contents.blt(118,49,hpbar,hpbar_rect)
if $game_party.actors[0].level <= 21
self.contents.draw_text(155, 38, 132, 32, "#{@actor.hp}/#{@actor.maxhp}")
else
self.contents.draw_text(227, 28, 132, 32, "#{@actor.hp}/#{@actor.maxhp}")
end
# Sp
mpbar = RPG::Cache.picture("MP")
mpbarwidth = mpbar.lammer * @actor.sp / @actor.maxsp
mpbarheight = mpbar.height
mpbar_rect = Rect.new(0,0,mpbarwidth,mpbarheight)
self.contents.blt(118,69,mpbar,mpbar_rect)
if $game_party.actors[0].level <= 34
self.contents.draw_text(155, 58, 132, 32, "#{@actor.sp}/#{@actor.maxsp}")
xpbar = RPG::Cache.picture("XP")
xpbarwidth = xpbar.lammer * @actor.now_exp / @actor.next_exp
xpbarheight = xpbar.height
xpbar_rect = Rect.new(0,0,xpbarwidth,xpbarheight)
self.contents.blt(33,91,xpbar,xpbar_rect)
self.contents.draw_text(120, 81, 132, 32, "#{@actor.now_exp}/#{@actor.next_exp}")
end
end
end
##49 48
class Scene_Map
alias hud_main main
def main
@Hud = Hud.new
hud_main
@Hud.dispose
end
alias hud_update update
def update
hud_update
@Hud.update
end
end
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
|
W razie czego PISZ na PW i dołącz link do tego tematu |
________________________ Pomogłem?!To w takim razie daj "Pomógł"
|
|