From e57a5b0b77c1ba3a2f05371c551d0e61fc9ce709 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 22 Aug 2016 17:10:20 +0200 Subject: Graphics, animation, general improvements --- config/menumain.lua | 46 +++++++++++++++++++++++++++++++--------------- config/menustart.lua | 6 ++++-- 2 files changed, 35 insertions(+), 17 deletions(-) (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua index 7c8ddf9..543a858 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -1,28 +1,44 @@ +local menu = ... + local button = require "button" +local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local button_x = width/2-29 + return { - button - :new("start") - :setPosition(10,40) + button:new(menu) + :setText("start") + :setPosition(button_x,60) :set("active", function () changeScene(Menu:new("menustart")) end) , - button - :new("join") - :setPosition(10,50) + button:new(menu) + :setText("join") + :setPosition(button_x,76) , - button - :new("settings") - :setPosition(10,60) + button:new(menu) + :setText("settings") + :setPosition(button_x,92) , - button - :new("credits") - :setPosition(10,70) + button:new(menu) + :setText("credits") + :setPosition(button_x,108) , - button - :new("exit") - :setPosition(10,80) + button:new(menu) + :setText("exit") + :setPosition(button_x,124) :set("active", love.event.quit) , + button:new(menu) + :setText("NEVER") + :setPosition(button_x,140) + :set("focus", function (self, next) + if next then + self.parent:next() + else + self.parent:previous() + end + end) + , } \ No newline at end of file diff --git a/config/menustart.lua b/config/menustart.lua index 03ca2f2..46015a9 100644 --- a/config/menustart.lua +++ b/config/menustart.lua @@ -1,8 +1,10 @@ +local menu = ... + local button = require "button" return { - button - :new("WORKED") + button:new(menu) + :setText("Go back") :setPosition(10,40) :set("active", function () changeScene(Menu:new("menumain")) -- cgit v1.1