diff options
author | Aki <nthirtyone@gmail.com> | 2016-06-01 14:12:04 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-06-01 14:12:04 +0200 |
commit | fc6143c8945cfcad9f23976c61e4d4bbb818f091 (patch) | |
tree | 5e1f83ac18cae321a706846a76fcb96f07eb68df /menu.lua | |
parent | 4f119e0e39a8055fd955d37224bda9c91f84e1a3 (diff) | |
download | roflnauts-fc6143c8945cfcad9f23976c61e4d4bbb818f091.zip roflnauts-fc6143c8945cfcad9f23976c61e4d4bbb818f091.tar.gz roflnauts-fc6143c8945cfcad9f23976c61e4d4bbb818f091.tar.bz2 |
Selectors positioning hardcoded
Diffstat (limited to 'menu.lua')
-rw-r--r-- | menu.lua | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 -- |