johnatm / itween

Automatically exported from code.google.com/p/itween
1 stars 2 forks source link

ScaleTo doesn't seem to call "oncomplete" and "onupdate" #50

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Called iTween.ScaleTo, passed a hashtable with oncomplete and and onupdate 
and they don't seem to be called.

iTween.ScaleTo(instance, newScaleToHash(theDistance));

Hashtable newScaleToHash(float scaleAmount){
        Hashtable ht = new Hashtable();
        Vector3 testScale = new Vector3(1,1,scaleAmount);

        ht.Add(iT.ScaleTo.speed, drawSpeed);
        ht.Add(iT.ScaleTo.scale, testScale);
        ht.Add(iT.ScaleTo.oncomplete, "reachedEnd");
        ht.Add(iT.ScaleTo.onupdate, "tester");
        //ht.Add("oncomplete", "reachedEnd"); //Just testing of adding with out the code hint

        ht.Add(iT.ScaleTo.easetype, "linear");

        return ht;
    }

    void tester(){
        print("Testing");
    }

    void reachedEnd(){

        print ("ReachedEnd");

    }

What is the expected output? What do you see instead?  I expect that the 
onComplete and onUpdate function are called.  They are called when using a 
similar implementation for MoveTo.  The scaling is working correctly, so I know 
it is receiving the correct parameters from the hash table.  It just isn't 
ending.

What version of the product are you using? On what operating system?  2.037 on 
OS X 10.6.5

Please provide any additional information below.

Thanks!  its a cool project.

Original issue reported on code.google.com by thedamia...@gmail.com on 26 Nov 2010 at 8:15

GoogleCodeExporter commented 8 years ago
Does animating object contain the callback methods? By default iTween will call 
these methods on the object that is running the iTween.  This is commonly 
overlooked and adding "onStartTarget" and "onCompleteTarget" should solve this 
issue.

Original comment by pixelplacement on 5 Jan 2011 at 6:37

GoogleCodeExporter commented 8 years ago
Thanks!  That was the problem.

Original comment by thedamia...@gmail.com on 22 Jan 2011 at 8:11