用RenderTexture,如果是个sprite,调用visit()后,将RenderTexture
auto callback = &](RenderTexture* rt, const std::string& path)
{
auto sprite = Sprite::create(path);
this->addChild(sprite);
sprite->setScale(0.9f);
sprite->setPosition(Vec2(100, 100));
};
_target->saveToFile(png, Image::Format::PNG, true, callback);
这样位置是正确的,会将新的图片显示到100,100位置。
但是如果换成Armature,无论如何setPosition,位置都是0,0。也就是在最左下角。这是什么原因呢?