Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Kingdom Heart Hud!
Autor Wiadomość
Loki 




Preferowany:
RPG Maker VX

Pomógł: 12 razy
Dołączył: 25 Kwi 2012
Posty: 162
Wysłany: Pią 04 Maj, 2012 18:49
Kingdom Heart Hud!
~ Kingdom Heart Hud ~


Autor:
Skive

Kompatybilność:
RPG Maker XP

Skrypt:
Spoiler:

Kod:
#==============================================================================
# ■ Kingdom Hearts HUD
#------------------------------------------------------------------------------
# by Skive
# skivedaft@yahoo.com
#
# --
#
# released on 5th March 2006
#==============================================================================

#==============================================================================
# ■ Sprite_HP
#------------------------------------------------------------------------------
#  the HUD's hp bar
#==============================================================================

class Sprite_HP < Sprite
#--------------------------------------------------------------------------
# &#9679; instances
#--------------------------------------------------------------------------
attr_writer :actor
#--------------------------------------------------------------------------
# &#9679; initialize
#--------------------------------------------------------------------------
def initialize(actor = nil)
super(nil)
self.z = 202
self.bitmap = Bitmap.new(60, 26)
@actor = actor
if !@actor.nil?
@hp = @actor.hp
@maxhp = @actor.maxhp
end
refresh
end
#--------------------------------------------------------------------------
# &#9679; refresh
#--------------------------------------------------------------------------
def refresh
self.bitmap.clear
return if @actor.nil?
@hp = @actor.hp
@maxhp = @actor.maxhp
draw_bar(20, 6)
self.angle = 270
end
#--------------------------------------------------------------------------
# &#9679; update
#--------------------------------------------------------------------------
def update
super
if @actor.nil?
self.bitmap.clear
return
end
if @hp != @actor.hp or @maxhp != @actor.maxhp
refresh
end
end
#--------------------------------------------------------------------------
# &#9679; draw_bar
#--------------------------------------------------------------------------
def draw_bar(radius, width)
max = (@actor.hp * 360) / @actor.maxhp
for j in 1..width
for i in 0..max
bx = Math.cos( (i * Math::PI) / 360) * (radius + j)
by = Math.sin( (i * Math::PI) / 360) * (radius + j)
case j
when 1
color = Color.new(74, 112, 29)
when 2
color = Color.new(77, 120, 29)
when 3
color = Color.new(80, 131, 28)
when 4
color = Color.new(85, 144, 27)
when 5
color = Color.new(89, 156, 26)
when 6
color = Color.new(93, 167, 26)
end
self.bitmap.set_pixel(30 + bx, by, color)
end
end
end
end

#==============================================================================
# &#9632; Sprite_SP
#------------------------------------------------------------------------------
# &#12288;the HUD's sp bar
#==============================================================================

class Sprite_SP < Sprite
#--------------------------------------------------------------------------
# &#9679; instances
#--------------------------------------------------------------------------
attr_writer :actor
#--------------------------------------------------------------------------
# &#9679; initialize
#--------------------------------------------------------------------------
def initialize(actor = nil)
super(nil)
self.z = 202
self.bitmap = Bitmap.new(60, 26)
@actor = actor
if !@actor.nil?
@sp = @actor.sp
@maxsp = @actor.maxsp
end
refresh
end
#--------------------------------------------------------------------------
# &#9679; refresh
#--------------------------------------------------------------------------
def refresh
self.bitmap.clear
return if @actor.nil?
@sp = @actor.sp
@maxsp = @actor.maxsp
draw_bar(20, 6)
self.angle = 90
self.mirror = true
end
#--------------------------------------------------------------------------
# &#9679; update
#--------------------------------------------------------------------------
def update
super
if @actor.nil?
self.bitmap.clear
return
end
if @sp != @actor.sp or @maxsp != @actor.maxsp
refresh
end
end
#--------------------------------------------------------------------------
# &#9679; draw_bar
#--------------------------------------------------------------------------
def draw_bar(radius, width)
max = (@actor.sp * 360) / @actor.maxsp
for j in 1..width
for i in 0..max
bx = Math.cos( (i * Math::PI) / 360) * (radius + j)
by = Math.sin( (i * Math::PI) / 360) * (radius + j)
case j
when 1
color = Color.new(29, 82, 112)
when 2
color = Color.new(29, 86, 120)
when 3
color = Color.new(28, 90, 131)
when 4
color = Color.new(27, 96, 144)
when 5
color = Color.new(26, 102, 156)
when 6
color = Color.new(26, 106, 167)
end
self.bitmap.set_pixel(30 + bx, by, color)
end
end
end
end

#==============================================================================
# &#9632; Sprite_HUD
#------------------------------------------------------------------------------
# &#12288;draws the HUD on the map
#==============================================================================

class Sprite_HUD < Sprite
#--------------------------------------------------------------------------
# &#9679; initialize
#--------------------------------------------------------------------------
def initialize(corner = 4)
super(nil)
self.z = 200
for actor in $game_party.actors
next if actor.dead?
@actor = actor
@actor_index = $game_party.actors.index(@actor)
break
end
@hp_sprite = Sprite_HP.new(@actor)
@sp_sprite = Sprite_SP.new(@actor)
self.bitmap = Bitmap.new(60, 60)
case corner
when 1
x = 16
y = 16
when 2
x = 640 - 52 - 16
y = 16
when 3
x = 16
y = 480 - 52 - 16
when 4
x = 640 - 52 - 16
y = 480 - 52 - 16
end
self.x = x
self.y = y
@hp_sprite.x = x + 27
@hp_sprite.y = y - 3
@sp_sprite.x = x + 27 - 1
@sp_sprite.y = y - 3 - 1 + 60
refresh
end
#--------------------------------------------------------------------------
# &#9679; refresh
#--------------------------------------------------------------------------
def refresh
self.bitmap.clear
return if @actor.nil?
bmp = RPG::Cache.character(@actor.character_name, @actor.character_hue)
rect = Rect.new(0, 0, bmp.width / 4, (bmp.height / 4))
self.bitmap.blt(27 - bmp.width / 8, 5, bmp, rect)
self.bitmap.blt(0, 0, RPG::Cache.picture("hud"), Rect.new(0, 0, 60, 60))
end
#--------------------------------------------------------------------------
# &#9679; update
#--------------------------------------------------------------------------
def update
super
@hp_sprite.update
@sp_sprite.update
if @actor != $game_party.actors[@actor_index]
@actor = $game_party.actors[@actor_index]
@hp_sprite.actor = @actor
@sp_sprite.actor = @actor
@hp_sprite.refresh
@sp_sprite.refresh
refresh
end
end
end

#==============================================================================
# &#9632; Scene_Map
#------------------------------------------------------------------------------
# &#12288;draws the hud on the map screen
# @khhud_corner is the corner you want the hud to be displayed in.
# 1 is upper left, 2 is upper right, 3 is bottom left and 4 is bottom right
#==============================================================================

class Scene_Map
alias main_khhud main
alias update_khhud update
alias transfer_khhud transfer_player
#--------------------------------------------------------------------------
# &#9679; initialize
#--------------------------------------------------------------------------
def initialize
@khhud_corner = 4 # 1 or 2 or 3 or 4
end
#--------------------------------------------------------------------------
# &#9679; main
#--------------------------------------------------------------------------
def main
@hud = Sprite_HUD.new(@khhud_corner)
main_khhud
@hud.dispose
end
#--------------------------------------------------------------------------
# &#9679; update
#--------------------------------------------------------------------------
def update
@hud.update
update_khhud
end
end


Screeny:
Spoiler:



Dodatkowe informacje:
Potrzebny obrazek: http://membres.multimania.fr/zeparodie/hud.png
 
 
overhill 




Preferowany:
RPG Maker XP

Dołączył: 31 Maj 2010
Posty: 55
Wysłany: Pią 04 Maj, 2012 21:49
Trochę biedny, ale w sumie może być, bardzo przejrzysty.
________________________
 
 
 
leszekp321 




Preferowany:
RPG Maker XP

Pomógł: 1 raz
Dołączył: 16 Mar 2012
Posty: 49
Skąd: jesteś?
Wysłany: Sob 05 Maj, 2012 22:29
Przydałby się jeszcze pasek EXP-a ale i tak jest dobrze
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene