cocos2d-x 截取像素

    auto ac = Sequence::create(DelayTime::create(3), CallFunc::create([=]() 
    {
        auto rt = RenderTexture::create(Director::getInstance()->getWinSize().width,
            Director::getInstance()->getWinSize().height,
            Texture2D::PixelFormat::RGBA8888);
        rt->beginWithClear(0.0f, 1.0f, 0.0f, 0.0f);
        Director::getInstance()->getRunningScene()->visit();
        rt->end();
        auto ret = rt->saveToFile("r2t.png");
        printf("%d\n",ret);
    }),nullptr);

    this->runAction(ac);

 

上一篇:Builder(建造者)


下一篇:LVS 三种模式简介