Andre4e Posted March 27, 2009 Share Posted March 27, 2009 (edited) Istruzioni all'interno dello scriptScreen:Prima:Adesso:Script: #===================================== #Gradient Bars with customizable lengths, thicknesses, types and Colors #By AcedentProne # Inserire questo in un evento: # # $game_variables[1] = Percentuale di Completamento # $scene = Scene_Progress.new # #===================================== class Window_Base def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255)) if type == "horizontal" width = length height = thick self.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 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255)) if type == "horizontal" width = length height = thick self.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 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end end #Game Progress Screen made by osbornecreations A.K.A Lewis Osborne #This was made by an englishman!!! (thats me) go on son! #Just put in a new screen above main. it shouldn't interfere with anything. #To call the script, use $scene = Scene_Progress.new and to change the #game progress bar, it is assigned using $game_variables[1] so through the game #call a script and type in something like $game_variables[1] =10 to make the game 10% complete. #=================================================== # - ClassScene_Progress #=================================================== class Scene_Progress #--------------------------------------------------------------------------------- def initialize end #--------------------------------------------------------------------------------- def main @window1 = Window_Progress.new @window1.x =160 @window1.y =200 @window1.height = 100 @window1.width = 341 #@window1.z = 200 Graphics.transition loop do Graphics.update Input.update if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # マップ画面に切り替え @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("", 0) $scene = Scene_Menu.new end #update if $scene != self break end end Graphics.freeze @window1.dispose end #--------------------------------------------------------------------------------- #--------------------------------------------------------------------------------- def update end #--------------------------------------------------------------------------------- end class Window_Progress < Window_Base #--------------------------------------------------------------------------------- def initialize super(0, 0, 341,100) self.contents = Bitmap.new(width - 50, height - 32) self.contents.font.name = "Tahoma" #o --> $fontface self.contents.font.size = 20 self.contents.font.color = text_color(0) self.contents.draw_text(200, 0, 200, 33, $game_variables[1]. to_s + "%") self.contents.draw_text(40, 0, 200, 33, "Progresso Gioco") draw_actor_barz(0,20,35, "horizontal", 255, 28,$game_variables[1],100) @sprite = Sprite.new @sprite.bitmap = RPG::Cache.panorama("004-CloudySky01", 0) end end Edited April 26, 2013 by Dilos Applicato tag code. http://files.nireblog.com/blogs4/narutozorro9kolas/files/firma-naruto-y-yondaime.gif Link to comment Share on other sites More sharing options...
Narutofan95 Posted March 29, 2009 Share Posted March 29, 2009 Bravo, in pratica hai aggiustato la scritta e cambiato il font, oltre a aver aggiunto la variabile proprio scritta. Bravo http://i46.tinypic.com/295vf6e.png merutochan Bandcamp | Twitter | Tumblr Link to comment Share on other sites More sharing options...
pennaverde Posted May 11, 2009 Share Posted May 11, 2009 mi dice errore riga 132 help plz :(errore.zip Link to comment Share on other sites More sharing options...
Davide Posted May 27, 2009 Share Posted May 27, 2009 C'è un errore sulla riga 132 sul carattere Tahoma rispondeteeeeeeeeeeee Cliacca per far aumentare la popolazione.Clicca per far aumentare le industrie. Link to comment Share on other sites More sharing options...
Davide Posted May 27, 2009 Share Posted May 27, 2009 Scusate ora ho capito cosa c'era che non andava, Tahoma deve stare tra le virgolette ("Tahoma") Cliacca per far aumentare la popolazione.Clicca per far aumentare le industrie. 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