-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Open
Description
- cocos2d-x version: 4.0
- devices test on: Windows 11 Pro
- developing environments
- IDE: Clion 2023.1.3
- Toolchain: Visual Studio
- Generator: Visual Studio 17 2022
- CMake: 3.26.3
When Run Code:
RenderTexture* pRender = RenderTexture::create(
static_cast<int>(tmpSprite->getContentSize().width),
static_cast<int>(tmpSprite->getContentSize().height),
backend::PixelFormat::RGBA8888);
// pRender->setSprite(tmpSprite);
pRender->begin();
tmpSprite->visit();
pRender->end();
pRender->newImage([role](Image* image) {
auto polygon = ImageAutoPolygon::generatePolygon(image);
role->initWithPolygon(polygon);
// role->updatePoly();
role->setVisible(true);
});
In line
auto polygon = ImageAutoPolygon::generatePolygon(image);
You Will get a incomplete Image Instance
Because Image::_data is null data
Like This:
When Use
Metadata
Metadata
Assignees
Labels
No labels