I'm using iTween.ValueTo to manipulate the buttons and other GUI objects I want to move. However, at the moment I have a seperate callback function for each one because it only takes one argument (the new value). For example:
iTween.ValueTo(gameObject, {"from":startBtn, "to":Rect(50,300,100,100), "time":.5, "onUpdate":"UpdateStartButton"});
function UpdateStartButton(pos:Rect) {
startBtn = pos;
}
This may be a bad way of doing it, please correct me if so. The problem with this method is I have many objects I want to move, and each one seems to need it's own function to callback and change the value.
I assume that using the hashtable it is possible to make the callback function take an additional argument (say, a Rect to update to) thereby making it possible to use one generic callback for all my ValueTo lines. However, I have no been able to find the correct syntax to do this.