goo.progressbar.luadoc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. --[[ Progress bar useful giving users feedback on loading or game status such as health, magic etc. ]]
  2. module 'goo.progressbar'
  3. --[[ Sets the range of the progress bar, i.e. if you're downloading a file 1024 bytes in size
  4. you would set the range to min = 0, max = 1024
  5. @param min:number the minimum value the progress bar will reperesent at 0% width.
  6. @param max:number the maximum value the progress bar will reperesent at 100% width.
  7. @return number: the range of the value ( max - min ).
  8. ]]
  9. function goo.progressbar:setRange( min, max )
  10. --[[ Increments the progress by 1 ]]
  11. function goo.progressbar:incrementProgress()
  12. --[[ Sets the progress value, should be a number within the range you defined.
  13. @param progress:number a number between the range you defined
  14. @see goo.progressbar:setRange
  15. ]]
  16. function goo.progressbar:setProgress( progress )
  17. --[[ Sets the width of the progress bar to the specified percentage, i.e. 50% is half the width.
  18. @param percentage:number a percentage value to set the width of the progress bar (0-100%).
  19. ]]
  20. function goo.progressbar:setPercentage( percentage )
  21. --[[ Returns the current progress value. ]]
  22. function goo.progressbar:getProgress()
  23. --[[ Returns the current percentage of progress.
  24. @return number: percentage of progress (0-100%).
  25. ]]
  26. function goo.progressbar:getPercentage()
  27. --[[ Internal function to draw the progress bar, you may wish to override however. ]]
  28. function goo.progressbar:draw()