Spike92 Posted October 14, 2006 Share Posted October 14, 2006 HUD di Kingdom HeartsDescrizioneQuesto script riprende l'HUD di Kingdom Hearts.AutoreSkiveAllegatiScreen: 1Istruzioni per l'uso Prima di tutto dovete prendere quest' immagine e metterla in picture:http://membres.lycos...parodie/hud.pngpoi scrivete questa roba in una sezione sopra Main #============================================================================== # ■ Kingdom Hearts HUD #------------------------------------------------------------------------------ # by Skive # skivedaft@yahoo.com # # -- # # released on 5th March 2006 #============================================================================== #============================================================================== # ■ Sprite_HP #------------------------------------------------------------------------------ # the HUD's hp bar #============================================================================== class Sprite_HP < Sprite #-------------------------------------------------------------------------- # ● instances #-------------------------------------------------------------------------- attr_writer :actor #-------------------------------------------------------------------------- # ● 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 #-------------------------------------------------------------------------- # ● refresh #-------------------------------------------------------------------------- def refresh self.bitmap.clear return if @actor.nil? @hp = @actor.hp @maxhp = @actor.maxhp draw_bar(20, 6) self.angle = 270 end #-------------------------------------------------------------------------- # ● update #-------------------------------------------------------------------------- def update super if @actor.nil? self.bitmap.clear return end if @hp != @actor.hp or @maxhp != @actor.maxhp refresh end end #-------------------------------------------------------------------------- # ● 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 #============================================================================== # ■ Sprite_SP #------------------------------------------------------------------------------ # the HUD's sp bar #============================================================================== class Sprite_SP < Sprite #-------------------------------------------------------------------------- # ● instances #-------------------------------------------------------------------------- attr_writer :actor #-------------------------------------------------------------------------- # ● 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 #-------------------------------------------------------------------------- # ● 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 #-------------------------------------------------------------------------- # ● update #-------------------------------------------------------------------------- def update super if @actor.nil? self.bitmap.clear return end if @sp != @actor.sp or @maxsp != @actor.maxsp refresh end end #-------------------------------------------------------------------------- # ● 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 #============================================================================== # ■ Sprite_HUD #------------------------------------------------------------------------------ # draws the HUD on the map #============================================================================== class Sprite_HUD < Sprite #-------------------------------------------------------------------------- # ● 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 #-------------------------------------------------------------------------- # ● 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 #-------------------------------------------------------------------------- # ● 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 #============================================================================== # ■ Scene_Map #------------------------------------------------------------------------------ # 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 #-------------------------------------------------------------------------- # ● initialize #-------------------------------------------------------------------------- def initialize @khhud_corner = 4 # 1 or 2 or 3 or 4 end #-------------------------------------------------------------------------- # ● main #-------------------------------------------------------------------------- def main @hud = Sprite_HUD.new(@khhud_corner) main_khhud @hud.dispose end #-------------------------------------------------------------------------- # ● update #-------------------------------------------------------------------------- def update @hud.update update_khhud end end Setta dei makeratori originali™ - SMO - #settadeimakeratorioriginalihttp://img131.imageshack.us/img131/3334/smobarpn5.png http://img138.imageshack.us/img138/7990/nonnafirmajz1kq9.jpg <DarK-SePHiRoTH-> raga sono mancato un anno ma a quanto vedo mahun non ha ancora imparato a disegnare :O <cip_e_ciop> picasso ha fatto per la pittura ciò che mahun ha fatto per i fumetti Link to comment Share on other sites More sharing options...
Lele Posted October 19, 2006 Share Posted October 19, 2006 argh spike hai sbagliato quello script nn l' ho fatto io, io l' avevo solo postato correggi XD Link to comment Share on other sites More sharing options...
Otaku Posted October 19, 2006 Share Posted October 19, 2006 Ho corretto io, state più attenti la prossima volta ;) Membro n. 6 della Link to comment Share on other sites More sharing options...
Lele Posted October 20, 2006 Share Posted October 20, 2006 grazie otaku XD Link to comment Share on other sites More sharing options...
Alato Posted December 4, 2006 Share Posted December 4, 2006 Aggiunto all'Elenco Script e applicato il Template. o•°' - '°•oHei, mitä kuuluu? http://imagegen.last.fm/winterheadphones/recenttracks/5/Alato.gif Link to comment Share on other sites More sharing options...
Deyan Posted December 10, 2006 Share Posted December 10, 2006 ha me nn funziona mi da errore sulla riga 251 http://img49.imageshack.us/img49/3363/deyan2pq3.jpg ~La mia skeda in Dragon Ball RPG [+]I miei ProgeTTi http://img266.imageshack.us/img266/2444/2977f117d51ip.gif Link to comment Share on other sites More sharing options...
Walrus1235 Posted October 17, 2007 Share Posted October 17, 2007 Ma che è questo HUD? One flew east, one flew west, one flew over the cuckoo's nest. Link to comment Share on other sites More sharing options...
Tio Posted October 17, 2007 Share Posted October 17, 2007 la barra dell'energia del personaggio principale appare in basso a destra nello schermo come in kingdom hearts ;) "Dopo gli ultimi Final Fantasy, ho capito solamente una cosa: che il gioco è bello quando Nomura poco."Making is not dead. You are dead.RELEASE: La Bussola d'Oro | Download | Video di anteprima - La Partenza di Hanna http://i.imgur.com/cFgc2lW.png Prova Standrama! Link to comment Share on other sites More sharing options...
Walrus1235 Posted October 27, 2007 Share Posted October 27, 2007 Hum... ma per energia si intende pv? Perchè in questo caso non funziona mica.. One flew east, one flew west, one flew over the cuckoo's nest. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now