@implementation Game { SPButton *_button; } - (id)init { if (self = [super init]) { // create a button SPTexture *buttonTexture = [SPTexture textureWithContentsOfFile:@"button.png"]; _button = [SPButton buttonWithUpState:buttonTexture]; [self addChild:_button]; // here's the interesting part: [_button addEventListener:@selector(onButtonTriggered:) atObject:self forType:SP_EVENT_TYPE_TRIGGERED]; } return self; } - (void)onButtonTriggered:(SPEvent *)event { NSLog(@"The button was triggered!"); }