2012-06-13 02:59:49 +08:00
|
|
|
#include "CCMenuItemImageLoader.h"
|
2012-06-01 08:07:02 +08:00
|
|
|
|
2012-09-24 11:47:33 +08:00
|
|
|
|
2012-06-01 08:07:02 +08:00
|
|
|
|
|
|
|
#define PROPERTY_NORMALDISPLAYFRAME "normalSpriteFrame"
|
|
|
|
#define PROPERTY_SELECTEDDISPLAYFRAME "selectedSpriteFrame"
|
|
|
|
#define PROPERTY_DISABLEDDISPLAYFRAME "disabledSpriteFrame"
|
|
|
|
|
2012-07-19 17:22:36 +08:00
|
|
|
NS_CC_EXT_BEGIN
|
|
|
|
|
2012-06-14 15:01:01 +08:00
|
|
|
void CCMenuItemImageLoader::onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, CCString * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader) {
|
|
|
|
if(pPropertyName->compare(PROPERTY_NORMALDISPLAYFRAME) == 0) {
|
2012-06-14 05:19:13 +08:00
|
|
|
if(pCCSpriteFrame != NULL) {
|
|
|
|
((CCMenuItemImage *)pNode)->setNormalSpriteFrame(pCCSpriteFrame);
|
|
|
|
}
|
2012-06-14 15:01:01 +08:00
|
|
|
} else if(pPropertyName->compare(PROPERTY_SELECTEDDISPLAYFRAME) == 0) {
|
2012-06-14 05:19:13 +08:00
|
|
|
if(pCCSpriteFrame != NULL) {
|
|
|
|
((CCMenuItemImage *)pNode)->setSelectedSpriteFrame(pCCSpriteFrame);
|
|
|
|
}
|
2012-06-14 15:01:01 +08:00
|
|
|
} else if(pPropertyName->compare(PROPERTY_DISABLEDDISPLAYFRAME) == 0) {
|
2012-06-14 05:19:13 +08:00
|
|
|
if(pCCSpriteFrame != NULL) {
|
|
|
|
((CCMenuItemImage *)pNode)->setDisabledSpriteFrame(pCCSpriteFrame);
|
|
|
|
}
|
2012-06-01 08:07:02 +08:00
|
|
|
} else {
|
|
|
|
CCMenuItemLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pCCSpriteFrame, pCCBReader);
|
|
|
|
}
|
2012-07-19 17:22:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_CC_EXT_END
|