SkillButton* SkillButton::create(const char* Normal, const char* Click ,const char* Mask , float CDTime ) { SkillButton* skillButton = new SkillButton(); if (skillButton && skillButton->init(Normal,Click,Mask,CDTime)) { skillButton->autorelease(); return skillButton; } else { CC_SAFE_DELETE(skillButton); return nullptr; } }
SkillButton* SkillButton::createSkillButton(float cdTime, const char* stencil_file_name, const char* button_normal_name, const char* button_click_name) { SkillButton* skillButton = new SkillButton(); if (skillButton && skillButton->init(cdTime, stencil_file_name, button_normal_name, button_click_name)) { skillButton->autorelease(); return skillButton; } else { delete skillButton; skillButton = NULL; } return NULL; }