summaryrefslogtreecommitdiffhomepage
path: root/menu.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-06-01 14:12:04 +0200
committerAki <nthirtyone@gmail.com>2016-06-01 14:12:04 +0200
commitfc6143c8945cfcad9f23976c61e4d4bbb818f091 (patch)
tree5e1f83ac18cae321a706846a76fcb96f07eb68df /menu.lua
parent4f119e0e39a8055fd955d37224bda9c91f84e1a3 (diff)
downloadroflnauts-fc6143c8945cfcad9f23976c61e4d4bbb818f091.zip
roflnauts-fc6143c8945cfcad9f23976c61e4d4bbb818f091.tar.gz
roflnauts-fc6143c8945cfcad9f23976c61e4d4bbb818f091.tar.bz2
Selectors positioning hardcoded
Diffstat (limited to 'menu.lua')
-rw-r--r--menu.lua9
1 files changed, 8 insertions, 1 deletions
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
--