Skip to content

Instantly share code, notes, and snippets.

@cqnature
Last active December 31, 2015 00:59
Show Gist options
  • Save cqnature/7911380 to your computer and use it in GitHub Desktop.
Save cqnature/7911380 to your computer and use it in GitHub Desktop.
-(id)init
{
if(self = [super init])
{
_backBtn.visible = YES;
_contentBg.visible = YES;
_heroLayer = [GMEExploreHeroLayer node];
[_contentBg addChild:_heroLayer];
_skillLayer = [GMEExploreSkillLayer node];
[_contentBg addChild:_skillLayer];
//hero btn and skill btn
__weak __block typeof(_skillLayer) skillLayer = _skillLayer;
_switchControl = [[[GMESwitch alloc]initWithLeftStr:[Common localizedStringForKey:@"Hero"] rightStr:[Common localizedStringForKey:@"Skill"]] autorelease];
_switchControl.priority = PopupPriorityThirdCommonBtn;
[_contentBg addChild:_switchControl];
_switchControl.position = (IsPad ? ccp(_contentBg.contentSize.width/2, _contentBg.contentSize.height - 308.0f/2) : ccp(_contentBg.contentSize.width/2 - 2, _contentBg.contentSize.height - 50.0f/2));
[_switchControl setLeftBlock:^{
_heroLayer.visible = YES;
_skillLayer.visible = NO;
} rightBlock:^{
_heroLayer.visible = NO;
_skillLayer.visible = YES;
// 用于新手导航
[[NSNotificationCenter defaultCenter] postNotificationName:kExploreSkillLayerShowNotification object:skillLayer];
}];
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment