Exemple #1
0
        private bool initFromNormalImage(string normalImage, string selectedImage, string disabledImage, SelectorProtocol target, SEL_MenuHandler selector)
        {
            CCNode cCNode  = CCSprite.spriteWithFile(normalImage);
            CCNode cCNode1 = null;
            CCNode cCNode2 = null;

            if (selectedImage != null && !string.IsNullOrEmpty(selectedImage))
            {
                cCNode1 = CCSprite.spriteWithFile(selectedImage);
            }
            if (disabledImage != null && !string.IsNullOrEmpty(disabledImage))
            {
                cCNode2 = CCSprite.spriteWithFile(disabledImage);
            }
            return(base.initFromNormalSprite(cCNode, cCNode1, cCNode2, target, selector));
        }
Exemple #2
0
        /// <summary>
        /// initializes a menu item with a normal, selected  and disabled image with target/selector
        /// </summary>
        bool initFromNormalImage(string normalImage, string selectedImage, string disabledImage, SelectorProtocol target, SEL_MenuHandler selector)
        {
            CCNode normalSprite   = CCSprite.spriteWithFile(normalImage);
            CCNode selectedSprite = null;
            CCNode disabledSprite = null;

            if (selectedImage != null && !string.IsNullOrEmpty(selectedImage))
            {
                selectedSprite = CCSprite.spriteWithFile(selectedImage);
            }

            if (disabledImage != null && !string.IsNullOrEmpty(disabledImage))
            {
                disabledSprite = CCSprite.spriteWithFile(disabledImage);
            }

            return(initFromNormalSprite(normalSprite, selectedSprite, disabledSprite, target, selector));
        }