efeberk 84 Posted December 16, 2013 Progress Bar for RGSS3 by efeberk Introduction This script will allow player waits while progress bar fills up. Call: progressbar(x, y, text, frames) x : window x coordinatey : window y coordinatetext = Messageframes = how long time costs to fill up progressbar Screenshots : Script : =begin =============================================================================== ProgressBar by efeberk Version: RGSS3 =============================================================================== This script will allow player waits while progress bar fills up. -------------------------------------------------------------------------------- Call: progressbar(x, y, text, frames) x : window x coordinate y : window y coordinate text = Message frames = how long time costs to fill up progressbar =end module EFE BAR_COLOR1 = Color.new(27, 174, 42, 255) BAR_COLOR2 = Color.new(206, 166, 36, 255) end class Window_ProgressBar < Window_Base def initialize(x, y, text, frames) @frame = 0 @frame2 = frames super(x, y, 250, 90) refresh(text) end def line_color color = normal_color color.alpha = 48 color end def draw_horz_line(y) line_y = y + line_height / 2 - 1 contents.fill_rect(0, line_y, contents_width, 2, line_color) end def refresh(text) contents.clear draw_horz_line(20) draw_text(0, 0, contents.width, 32, text, 1) @frame += 1.0 / @frame2.to_f draw_gauge(0, 32, contents.width, @frame, EFE::BAR_COLOR1, EFE::BAR_COLOR2) end end class Scene_ProgressBar < Scene_Base def start super create_window create_background end def prepare(x, y, text, frames) @window_x = x @window_y = y @text = text @frames = frames end def update super @frames -= 1 @progressbar.refresh(@text) SceneManager.return if @frames == 1 end def create_window @progressbar = Window_ProgressBar.new(@window_x, @window_y, @text, @frames) end def create_background @background_sprite = Sprite.new @background_sprite.bitmap = SceneManager.background_bitmap end end class Game_Interpreter def progressbar(x, y, text, frames) SceneManager.call(Scene_ProgressBar) SceneManager.scene.prepare(x, y, text, frames) Fiber.yield while SceneManager.scene_is?(Scene_ProgressBar) end end 1 Share this post Link to post Share on other sites
DartKain 1 Posted December 16, 2013 Amazing script. Simple and fine. I try it in white colour... Share this post Link to post Share on other sites
Shojiki 0 Posted January 2, 2014 Help me. I r to noob to use script ;/. How do i utilize the script after pasting it under materials. Everytime i do a script call and enter progressbar(x, y, text, frames), with whatever adjustments i do with in that line. The game says I get an error ;/ Share this post Link to post Share on other sites
efeberk 84 Posted January 2, 2014 (edited) If you share screen of error, i can help example : progressbar(100, 200, "Hacking", 60) : Wait 1 sec to load bar with a text "Hacking" Edited January 2, 2014 by efeberk Share this post Link to post Share on other sites
Shojiki 0 Posted January 4, 2014 (edited) Your example sort of helped me XD, I didn't know I had to put quotations for the text. When I didn't this would appear: Edited January 4, 2014 by Shojiki Share this post Link to post Share on other sites
efeberk 84 Posted January 5, 2014 You need to use quotations(") or (') to tell to RGSS3 that it is a string. Share this post Link to post Share on other sites