Esempio n. 1
0
MyMenuItem* MyMenuItem::create(cocos2d::Node* enabledSprite, cocos2d::Node* disabledSprite, const cocos2d::ccMenuCallback& callback)
{
	MyMenuItem* ret = new MyMenuItem();
	ret->initWithNormalSprite(enabledSprite, nullptr, disabledSprite, callback);
	ret->mEnabled = true;
	ret->autorelease();
	
	return ret;
}
Esempio n. 2
0
MyMenuItem* MyMenuItem::create(const char *normalImage, const char *selectedImage, CCObject* target, SEL_MenuHandler selector)
{
    MyMenuItem *pobSprite = new MyMenuItem();
    if (pobSprite && pobSprite->initWithNormalImage(normalImage, selectedImage, normalImage, target, selector))
    {
        
        pobSprite->autorelease();
        
        
        return pobSprite;
    }
    CC_SAFE_DELETE(pobSprite);
    
    return NULL;
    
}
Esempio n. 3
0
MyMenuItem* MyMenuItem::create(const char *normalImage, CCObject* target, SEL_MenuHandler selector)
{
    MyMenuItem *pobSprite = new MyMenuItem();
    if (pobSprite && pobSprite->initWithNormalImage(normalImage, normalImage, normalImage, target, selector))
    {
        pobSprite->setScale(g_fResScale);
        pobSprite->isDefaultAction = true;
        pobSprite->runAction(MenuAction::defaultMenuAction());
        pobSprite->autorelease();
        
        
        return pobSprite;
    }
    CC_SAFE_DELETE(pobSprite);
    
    return NULL;

}