开发者

my sprite is undeclared?

开发者 https://www.devze.com 2023-02-18 05:56 出处:网络
i declared the sprite in my .h but how do i call the sprite from the node i declared it in so that i don\'t get the error that it is undeclared.

i declared the sprite in my .h but how do i call the sprite from the node i declared it in so that i don't get the error that it is undeclared.

@int开发者_开发百科erface MyNode : CCNode{
CCSprite *Bsprite1, *Tsprite1, *currentSprite;  
Boolean isChanging;

}
@end

currentSprite = [c1array objectAtIndex:i];
//error 'currentSprite' undeclared.


try separate the CCSprite declarations..

CCSprite* Bsprite1;
CCSprite* Tsprite1;
CCSprite* currentSprite;

I hope your currentSprite = [c1array objectAtIndex:i]; is at your .m..


i got it working had to create a pointer to it MyNode *currentSprite

0

精彩评论

暂无评论...
验证码 换一张
取 消