From fc6143c8945cfcad9f23976c61e4d4bbb818f091 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 1 Jun 2016 14:12:04 +0200 Subject: Selectors positioning hardcoded --- menu.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/menu.lua b/menu.lua index dcfd859..2e15881 100644 --- a/menu.lua +++ b/menu.lua @@ -9,6 +9,7 @@ require "selector" -- Metatable of `Menu` Menu = { logo = nil, + -- move selectors to one table; make functions to retrieve selectors w or w/o controller selectors = nil, selected = nil, nauts = require "nautslist", @@ -34,7 +35,13 @@ end -- Naut selector function Menu:newSelector() - table.insert(self.selectors,Selector:new(self)) + local selector = Selector:new(self) + local w, h = love.graphics.getWidth()/self.scale, love.graphics.getHeight()/self.scale + local n = #self.selectors - 1 + table.insert(self.selectors, selector) + local x = (w-79)/2+n*38 + local y = h/2-16 + selector:setPosition(x, y) end -- -- cgit v1.1