Hello,
So I was follow Newnams tutorial on Level Selection, tweaked it around, and now I have 9 widget buttons stored in a group, each of which are spaced out evenly. Now the plan is to have a button that’ll move this group of 9 levels, and bring in another 9 levels.
Code to display icons for levels:
[code] – Pots
for i = 0,2 do
for j = 1,3 do
current = i* 3+ j
levelsGroupOne[current] = widget.newButton {
label = current,
id=current,
width = 120,
height=122,
defaultColor = {255,0,0,255},
strokeColor = {0,0,0,0},
onRelease = buttonRelease
–default = square = display.newRect(0,0,120,122),
}
levelsGroupOne[current].x = 15 + (j*150)
levelsGroupOne[current].y = 275 + (i*165)
end
end[/code]
Problem is, when I try to move the objects, every time I move them back, the spacing between them messes up thus when they come back, all buttons are stacked on top of each other.
My attempt at moving (for left button only):
function goLeft(e)
if (e.phase == "ended") then
print ("scroll left");
--tweenLeft = transition.to (levelsGroupOne, { time = 100, delay = 1000, x = -100})
for i = 1, #levelsGroupOne do
transition.to (levelsGroupOne, { time = 300, delay = 0, x = -100})
end
end
end
While I’m at it, can someone please tell me how I can substitute the red-squares (used to make a button) for a graphic?
Thank you [import]uid: 184921 topic_id: 34400 reply_id: 334400[/import]