summaryrefslogtreecommitdiffhomepage
path: root/config/menus
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-05 02:03:35 +0200
committerAki <nthirtyone@gmail.com>2017-09-05 02:03:35 +0200
commit78654392715768991cb10fc7c1aca60859e58516 (patch)
treede64e6713ee4d44011be323db1decfdd69a32005 /config/menus
parent0406d5d9617d20b528d2c5135a2474c19e23e9fa (diff)
downloadroflnauts-78654392715768991cb10fc7c1aca60859e58516.zip
roflnauts-78654392715768991cb10fc7c1aca60859e58516.tar.gz
roflnauts-78654392715768991cb10fc7c1aca60859e58516.tar.bz2
Centered nauts selectors group
Diffstat (limited to 'config/menus')
-rw-r--r--config/menus/select.lua12
1 files changed, 5 insertions, 7 deletions
diff --git a/config/menus/select.lua b/config/menus/select.lua
index a3c379b..c4a9595 100644
--- a/config/menus/select.lua
+++ b/config/menus/select.lua
@@ -28,19 +28,17 @@ do
end
group = Group(menu)
- local
- function add (element)
- table.insert(group.children, element)
- return element
- end
for i,_ in pairs(Controller.getSets()) do
- add(Selector(nauts, group, menu))
- :setPosition(10+48*(i-1), 10)
+ group:addChild(Selector(nauts, group, menu))
:set("icons_atlas", atlas)
:set("icons_quads", icons)
end
+ group:set("margin", 16)
+ local gw, gh = group:getSize()
+ group:setPosition((width - gw)/2, 10)
+
function get ()
local selection = group:callEach("getSelected")
for i,naut in ipairs(selection) do