Exemple #1
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;
    
}
Exemple #2
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;

}