Advertisement
theoriginalbit

Loading API: Example — LOGO_IS_OVERLAY

Jan 13th, 2013
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. os.loadAPI("Loading-Bar/load")
  2.  
  3. local logo = {
  4.   "7   7              7     7        77 3   3 3  ",
  5.   "7   7                              7 3     3  ",
  6.   "777 777 777 777 77 7 777 7 777 777 7 333 3 333",
  7.   "7   7 7 7 7 7 7 7  7 7 7 7 7 7 7 7 7 3 3 3 3  ",
  8.   "7   7 7 777 7 7 7  7 777 7 7 7 777 7 3 3 3 3  ",
  9.   "7   7 7 7   7 7 7  7   7 7 7 7 7 7 7 3 3 3 3  ",
  10.   " 77 7 7 777 777 7  7 777 7 7 7 7 7 7 333 3  33",
  11. }
  12.  
  13. local bar = load.init( load.LOGO_IS_OVERLAY, logo, 10, nil, 14, nil, "Starting up...", "Load Screen Example", "By TheOriginalBIT" )
  14.  
  15. local function dostuff()
  16.   bar:setMessage("Downloading...")
  17.   for i = 1, 9 do
  18.     sleep(1)
  19.     bar:triggerUpdate( "Downloading ("..( bar:getCurrentProgress() + 1 ).."/10)..." )
  20.   end
  21.  
  22.   bar:triggerUpdate( "Done!" )
  23. end
  24.  
  25. local function dobar()
  26.   bar:run( true )
  27. end
  28.  
  29. parallel.waitForAll( dobar, dostuff )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement