summaryrefslogtreecommitdiffhomepage
path: root/not/Button.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-08-13 02:26:55 +0200
committerAki <nthirtyone@gmail.com>2017-08-13 02:26:55 +0200
commitb1cf14d64a2d3e28683db87190c4b2c7799c259d (patch)
treee45dac5cc6ce5265e3e3e2c914eb7cc92a820b8b /not/Button.lua
parent0dd01913fe0eefc7ba4bc0797877f40fdedf9315 (diff)
parented62b573417bdc85bec616f6016846b02de4c906 (diff)
downloadroflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.zip
roflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.tar.gz
roflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.tar.bz2
Merge branch 'multi'maps
Diffstat (limited to 'not/Button.lua')
-rw-r--r--not/Button.lua29
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)