diff options
author | Aki <nthirtyone@gmail.com> | 2017-04-07 02:53:36 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-04-07 02:53:36 +0200 |
commit | 37767d6c54ea6af0b4631b5ce838ee584603895e (patch) | |
tree | e0dd1549c5a8f3342b36df9469660046c8c03208 /config/menus/main.lua | |
parent | 20770db3aba953585495d21bfe0a2e430485b038 (diff) | |
download | roflnauts-37767d6c54ea6af0b4631b5ce838ee584603895e.zip roflnauts-37767d6c54ea6af0b4631b5ce838ee584603895e.tar.gz roflnauts-37767d6c54ea6af0b4631b5ce838ee584603895e.tar.bz2 |
Moved menu configs to subdirectory
Diffstat (limited to 'config/menus/main.lua')
-rw-r--r-- | config/menus/main.lua | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/config/menus/main.lua b/config/menus/main.lua new file mode 100644 index 0000000..661299c --- /dev/null +++ b/config/menus/main.lua @@ -0,0 +1,59 @@ +local menu = ... + +local button = require "button" +local header = require "header" +local element = require "element" + +local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() +local bx = width/2-29 + +local awesometwo = love.graphics.newImage("assets/two.png") + +return { + button:new(menu) + :setText("Start") + :setPosition(bx, 80) + :set("active", function (self) + self.parent:open("host") + end) + , + button:new(menu) + :setText("Join") + :setPosition(bx, 96) + :set("isEnabled", function (self) + return false + end) + , + button:new(menu) + :setText("Settings") + :setPosition(bx, 112) + :set("active", function (self) + self.parent:open("settings") + end) + , + button:new(menu) + :setText("Credits") + :setPosition(bx, 128) + :set("active", function (self) + self.parent:open("credits") + end) + , + button:new(menu) + :setText("Exit") + :setPosition(bx, 144) + :set("active", love.event.quit) + , + element:new(menu) + :setPosition(width/2, 15) + :set("draw", function (self, scale) + local x,y = self:getPosition() + love.graphics.setColor(255, 255, 255, 255) + love.graphics.setFont(Bold) + love.graphics.draw(awesometwo, x*scale, y*scale, 0, scale, scale, 35) + end) + , + header:new(menu) + :setText("Roflnauts") + :setPosition(width/2,40) + , +}
\ No newline at end of file |