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));
相关文章推荐
- C++构造函数中用参数列表初始化成员
- C++基础编程----1.1预备知识
- Python调用C++
- C++全局变量在多个源代码文件中的使用
- 图像处理之C语言实现二维卷积
- 笔记-C语言-第一节 进制 printf scanf
- C++Primer第五版 练习11.14(解答)
- C++Primer第五版 练习11.13(解答)
- C++Primer第五版 练习11.12(解答)
- C、C++头文件命名约定
- C++Primer第五版 11.2.3节练习(解答)
- 【c语言】 寻找十个整数中的最大值
- C/C++程序员必须熟练应用的开源项目
- C++源代码文件的扩展名
- 【c语言】 交换两个整形变量的值(要求不创建临时变量)
- 【转载】C++new的用法
- C语言求两个整数的最大公约数
- c语言状态机
- 面对不同类型的数值,我们如何使用结构体进行赋值
- 《pointers on c》的第1个例子