Narendrabrsoft / cocos2d-android-1

Automatically exported from code.google.com/p/cocos2d-android-1
0 stars 0 forks source link

java.lang.ClassCastException in CCSprite.updateTransform #85

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a image sprite with an  Image of size 256x256 pixels
2. scale the sprite by calling sprite.setScaleX(0.5f), sprite.setScaleY(0.75f);
3. call sprite.updateTransform() to expect correct values, if we call   
sprite.getVertices() later.

What is the expected output? What do you see instead?
updateTransform() should update the values of vertexes in the class.
Instead, there is a java.lang.ClassCastException at statement 
CCSprite sprP = (CCSprite)p; in class CCSprite.

What version of the product are you using? On what operating system?
Android 2.2 and latest compiled cocos2d-android-1.

Please provide any additional information below.
This occurs in either of the cases

1. CCSprite object is a child of CCLayer object.

2. CCSprite object  is a child of a CCNode object and that CCNode is child of 
the CCLayer.

Original issue reported on code.google.com by np.maha...@gmail.com on 7 Jul 2011 at 11:09

GoogleCodeExporter commented 8 years ago
yes, i got the same exception. I just used the function rotate e.g
Sprite.setRotation(.25f);
Sprite.updateTransform();

it shows exception at the same line, for loop was running for the 2nd time. 

Original comment by me.farha...@gmail.com on 11 Oct 2011 at 2:34