change texture to textureName

This commit is contained in:
2youyou2 2014-06-13 19:52:53 +08:00
parent 5bce6b87ea
commit d9f34a1412
3 changed files with 8 additions and 8 deletions

View File

@ -343,7 +343,7 @@ Frame* ActionTimelineCache::loadTextureFrame(const rapidjson::Value& json)
path = jsonPath + texture;
}
frame->setTexture(path);
frame->setTextureName(path);
}
return frame;
}

View File

@ -108,7 +108,7 @@ TextureFrame* TextureFrame::create()
}
TextureFrame::TextureFrame()
: _texture("")
: _textureName("")
{
}
@ -123,12 +123,12 @@ void TextureFrame::onEnter(Frame *nextFrame)
{
if(_sprite)
{
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(_texture);
SpriteFrame* spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(_textureName);
if(spriteFrame != nullptr)
_sprite->setSpriteFrame(spriteFrame);
else
_sprite->setTexture(_texture);
_sprite->setTexture(_textureName);
}
}
@ -136,7 +136,7 @@ void TextureFrame::onEnter(Frame *nextFrame)
Frame* TextureFrame::clone()
{
TextureFrame* frame = TextureFrame::create();
frame->setTexture(_texture);
frame->setTextureName(_textureName);
frame->cloneProperty(this);

View File

@ -98,12 +98,12 @@ public:
virtual void onEnter(Frame *nextFrame) override;
virtual Frame* clone() override;
inline void setTexture(std::string texture) { _texture = texture;}
inline std::string getTexture() const { return _texture; }
inline void setTextureName(std::string textureName) { _textureName = textureName;}
inline std::string getTextureName() const { return _textureName; }
protected:
cocos2d::Sprite* _sprite;
std::string _texture;
std::string _textureName;
};
class RotationFrame : public Frame