Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Button = {}
- function Button.create()
- local new = setmetatable({}, Button)
- new.x = 0
- new.y = 0
- new.w = 200
- new.h = 80
- return new
- end
- function Button:draw()
- paintutils.fill(self.x, self.y, self.w, self.h)
- end
- btn = Button.create()
- btn.x = 30
- btn.y = 20
- -- Or have those as params to create()
- -- Here's how you draw a shotload of buttons:
- for i = 1, #mydrawables do
- mydrawables[i]:draw()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement