I’m trying to save time by creating one method that all of my drag-able objects can use. I need to pass the object that is being touched into the onPress function so that I can do what needs to be done with the the proper object.
So basically what I have no clue how to do is how to pass a parameter into the onPress property of setDrag.
This is what I have, right now which works properly
[lua] chickc:setDrag{
drag=true,
onPress=chickPressFunction,
onRelease=chickReleaseFunction,
bounds = { 0, 0, 768, 1024 }
}[/lua]
This is what I want to dol Make a more generic press function and pass in to object.
[lua]chickc:setDrag{
drag=true,
onPress=PressFunction(chickc),
onRelease=ReleaseFunction(chickc),
bounds = { 0, 0, 768, 1024 }
}[/lua]
I tried this but, the function does not even get called. Any suggestions? [import]uid: 111428 topic_id: 19600 reply_id: 319600[/import]