diff options
author | Aki <nthirtyone@gmail.com> | 2017-08-13 02:26:55 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-08-13 02:26:55 +0200 |
commit | b1cf14d64a2d3e28683db87190c4b2c7799c259d (patch) | |
tree | e45dac5cc6ce5265e3e3e2c914eb7cc92a820b8b /config/menus/pause.lua | |
parent | 0dd01913fe0eefc7ba4bc0797877f40fdedf9315 (diff) | |
parent | ed62b573417bdc85bec616f6016846b02de4c906 (diff) | |
download | roflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.zip roflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.tar.gz roflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.tar.bz2 |
Merge branch 'multi'maps
Diffstat (limited to 'config/menus/pause.lua')
-rw-r--r-- | config/menus/pause.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/config/menus/pause.lua b/config/menus/pause.lua new file mode 100644 index 0000000..60aa2fc --- /dev/null +++ b/config/menus/pause.lua @@ -0,0 +1,35 @@ +local menu = ... + +local Button = require "not.Button" +local Element = require "not.Element" + +local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() +local bx = width/2-29 + +return { + Element(menu) + :set("draw", function (self, scale) + love.graphics.setColor(0, 0, 0, 110) + local width, height = love.graphics.getWidth(), love.graphics.getHeight() + love.graphics.rectangle("fill", 0, 0, width, height) + end) + , + Button(menu) + :setText("Unpause") + :setPosition(bx, height - 38) + :set("active", function (self) + sceneManager:removeTopScene() + local scene = sceneManager:getAllScenes()[1] + scene:setSleeping(false) + scene:setInputDisabled(false) + end) + , + Button(menu) + :setText("Exit") + :setPosition(bx, height - 22) + :set("active", function (self) + sceneManager:removeTopScene() + sceneManager:changeScene(Menu("main")) + end) + , +} |