Hello Everyone! My current project has a screen with several button that all basically do the same thing. I currently have a function for each individual button. I want to minimize my code and make a single function. I don’t really know how to ask the question, so I’ll show some code to help myself. I’ll simplify it…
[lua]–THE FUNCTION
local myButtonFunction = function( event)
if event.phase == “release” then
bluecircle.x = BUTTONPRESSED.x --I want the blue circle to move to the coordinates
bluecircle.y = BUTTONPRESSED.y --of the button that was pressed
end
end
–THE BUTTON
local myButton = widget.newButton{
default = “myButtonImage.png”,
width = 50,
height = 50,
onRelease = myButtonFunction,
}[/lua]
There you go. Is this possible? If so, how is it done? Thank you!!
Nathan [import]uid: 39302 topic_id: 26233 reply_id: 326233[/import]

[import]uid: 39302 topic_id: 26233 reply_id: 106340[/import]