Replacing image in sprite - cocos2d game development of iphone
Posted
by sagar
on Stack Overflow
See other posts from Stack Overflow
or by sagar
Published on 2009-10-13T21:48:34Z
Indexed on
2010/04/20
15:03 UTC
Read the original article
Hit count: 605
I want to change the sprite image.
Say for example.
mainSprite=[Sprite spriteWithFile:@"redFile.png"];
[self addChild:mainSprite];
Here, Sprite is already added to a layer. I have mainSprite (pointer) which can access it.
If I change
[mainSprite setOpacity:150];
it works perfectly. But Here I want to change the sprite image instead of opacity.
But Don't know how?
Thanks in advance for helping me.
Sagar
© Stack Overflow or respective owner