function stateMenu() local items = {"play", "rules"} local buttons = {} function _enter() for k,v in ipairs(items) do local button = makeButton(10, k*10, 30, 6, v, function() printh("click") end) add(buttons, button) end end return { _enter = _enter, _update = function() for button in all(buttons) do button:update() end end, _draw = function() for button in all(buttons) do button:draw() end end } end