Skip to content

Instantly share code, notes, and snippets.

@chrisdugne
Created March 22, 2019 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdugne/344e2af4409d282a67b11bd413f521fd to your computer and use it in GitHub Desktop.
Save chrisdugne/344e2af4409d282a67b11bd413f521fd to your computer and use it in GitHub Desktop.
vertical positioning, 2 by 2
local alternate = require 'cherry.libs.alternate'
self.buttons = {}
for i = 1, #keys do
self.buttons[#self.buttons + 1] =
createButton({
name = 'button-' .. i,
parent = scroller,
x = display.contentWidth / 2 + alternate(i) * 100,
y = display.contentHeight / 2 - 300 + math.ceil(i / 2) * 250
})
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment