- (id)initWithWidth:(float)width height:(float)height { self = [super initWithWidth:width height:height]; sxSwitch = [[SXSwitch alloc] init]; [sxSwitch addEventListener:@selector(onValueChange:) atObject:self forType:SX_SWITCH_EVENT_CHANGED]; [self addChild:sxSwitch]; return self; } - (void)onValueChange:(SPEvent*)event{ NSLog(@"slider val: %@", (sxSwitch.on)?@"true":@"false"); }
No comments so far. Feel free to edit this part of the page.