Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screen = self.CreateLink("screen")
- function ProgressBar(x, y, w, perc)
- local extra = w * perc
- local fg = string.rep(" ", extra)
- local bg = string.rep(" ", w)
- screen.Draw(bg, x, y, Color(0, 0, 0, 0), Color(0, 0, 0, 127))
- screen.Draw(fg, x, y, Color(0, 0, 0, 0), Color(127, 127, 127))
- screen.Draw( tostring(perc * 100) .. "%", x + w * 0.5 - 2, y)
- end
- function Think()
- if not screen.Connected then return 1 end
- screen.Clear(Color(0, 0, 0, 0))
- screen.Draw("Hello, world.", 1, 16, Color(255, 0, 0, 255), Color(0, 0, 0, 0))
- ProgressBar(1, 17, 30, 0.1)
- return 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement