Here's what I currently have setup:
SPTexture *testBtnObject = [SPTexture textureWithContentsOfFile:@"testing.png"]; SPButton *testBtn = [SPButton buttonWithUpState:testBtnObject]; testBtn.x = 100; testBtn.y = 100; [self addChild:testBtn]; [testBtn addEventListener:@selector(testBtn_Click:) atObject:self forType:SP_EVENT_TYPE_TRIGGERED];
I have a method that looks like this:
- (void)testBtn_Click:(SPEvent *)event { testBtn.x = 200; testBtn.y = 200; }
Which obviously doesn't work, as testBtn was defined in a different scope. Do I need to make a declaration of TestBtn in the Game header file? How could I make it so that I can reference the object through all of my methods.
Thanks!