diff options
author | Aki <nthirtyone@gmail.com> | 2017-06-27 09:02:03 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-06-27 09:02:03 +0200 |
commit | baf04a055dbc66b80c29a406907a0a595ac55f00 (patch) | |
tree | 49559118c1c6246cf7f954e9f706bae6f29e5057 /not/Button.lua | |
parent | 2c458f0c756ebe577083a7cc972a07e870cb0ba9 (diff) | |
download | roflnauts-baf04a055dbc66b80c29a406907a0a595ac55f00.zip roflnauts-baf04a055dbc66b80c29a406907a0a595ac55f00.tar.gz roflnauts-baf04a055dbc66b80c29a406907a0a595ac55f00.tar.bz2 |
Moved ui elements to use new oop lib
Diffstat (limited to 'not/Button.lua')
-rw-r--r-- | not/Button.lua | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/not/Button.lua b/not/Button.lua index 91aca45..a2f7a19 100644 --- a/not/Button.lua +++ b/not/Button.lua @@ -1,27 +1,18 @@ +require "not.Element" + --- `Button` -- Menu element that can be activated by user. -Button = { - parent = --[[not.Menu]]nil, - x = 0, - y = 0, - text = "", - focused = false, - sprite, - quads, - delay = 2, - parent, -} +Button = Element:extends() --- `Button` is a child of `Element`. -require "not.Element" -Button.__index = Button -setmetatable(Button, Element) +Button.text = "" +Button.focused = false +Button.sprite = --[[]]nil +Button.quads = --[[]]nil +Button.delay = 2 function Button:new (parent) - local o = setmetatable({}, self) - o.parent = parent - o.sprite, o.quads = parent:getSheet() - return o + Button.__super.new(self, parent) + self.sprite, self.quads = parent:getSheet() end function Button:setText (text) |