So I’m making buttons using the widget.newButton. I’d like to change the widget icons with a custom graphic instead of a square. This is what I have done so far:
for i = 0,2 do
for j = 1,3 do
current = i\* 3+ j
local button1 = 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)
button1.x = 15 + (j\*150)
button1.y = 275 + (i\*165)
levelGroupOne:insert(button1)
end
end
I was using this tutorial which helped a bit: http://developer.coronalabs.com/reference/index/widgetnewbutton But it doesn’t really go into describing how to use custom graphics. How can I do this?
While I’m asking, is it possible to change these graphics; what the buttons are used for are level selectors and I essentially wanted a unlockable levels. I have a separate graphics for locked levels and unlocked levels; is it possible to use two sets of graphics?
Thank you [import]uid: 184921 topic_id: 36151 reply_id: 336151[/import]