您的位置:首页 > 编程语言 > C语言/C++

c++ renderTexture

2015-09-29 15:08 501 查看
	//先给桌面添加颜色背景auto cly = LayerColor::create(Color4B(120, 230, 0, 120), vSize.width, vSize.height);addChild(cly);//在桌面上创建两个循环运动的物体,然后看看render怎么用auto sp1 = Sprite::create("a.png");sp1->setAnchorPoint(Vec2(5, 0.5));/* Create the render texture */auto renderTexture = RenderTexture::create(vSize.width, vSize.height, Texture2D::PixelFormat::RGBA4444);renderTexture->setPosition(Vec2(vSize.width / 2, vSize.height / 2));// renderTexture->setScale(2.0f);/* add the sprites to the render texture */renderTexture->addChild(sp1);//renderTexture->setClearColor(Color4F(0, 0, 0, 0));renderTexture->setClearColor(Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1));/* add the render texture to the scene */addChild(renderTexture);renderTexture->setAutoDraw(true);auto seqAction = RotateBy::create(2, 360);//RotateBy::create(2, Vec3(360,360,0));sp1->runAction(RepeatForever::create(seqAction));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: