I have a class ButtonLayer with a method in it called redClick. redClick's implementation looks like this..
-(void) redClick {
[red runAction: [CCTintTo actionWithDuration:0.1 red:200 green:200 blue:200]];
}
The variable red is a CCSprite in the ButtonLayer class.
I have another class called MainLayer that inherits from CCLayer. The scene method in this class looks like this..
+(CCScene *) scene
{
CCScene *scene = [CCScene node];
overlay = [ButtonLayer node];
HelloWorldLayer *layer = [HelloWorldLayer node];
[scene addChild: layer];
[scene addChild: overlay];
return scene;
}
In my ccTouchesBegan method in MainLayer, I call [overlay redClick], but when I call it, nothing changes. The CCSprite remains unchanged.