mirror of https://github.com/axmolengine/axmol.git
change texture to textureName
This commit is contained in:
parent
5bce6b87ea
commit
d9f34a1412
|
@ -343,7 +343,7 @@ Frame* ActionTimelineCache::loadTextureFrame(const rapidjson::Value& json)
|
|||
path = jsonPath + texture;
|
||||
}
|
||||
|
||||
frame->setTexture(path);
|
||||
frame->setTextureName(path);
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue