sprite = CCSprite::create() ``` 没有在create的时候就带上一个图片路径, 那之后如何补上这个?
小白求助啊… 真的没人回复么
楼主什么意思?
是这样的, 在create的时候,没有带上任何参数
sprite = CCSprte::create()
想在后面再使用,sprite->setPic(xxx) 类似这样的方法去设置一张显示的图片…
不知道有没这样的方法, 我看了代码,没找到类似的
/** Sets a new texture (from a filename) to the sprite.
It will call `setTextureRect()` with the texture's content size.
TODO: The whole Sprite API needs to be reviewed.
*/
virtual void setTexture(const std::string &filename );
/** Sets a new texture to the sprite.
The Texture's rect is not changed.
*/
virtual void setTexture(Texture2D *texture) override;
```
非常感谢