cocos2d-x3.0 RenderTexture(二)
来源:互联网 发布:sql怎么导入数据 编辑:程序博客网 时间:2024/05/16 01:40
.h
#include "cocos-ext.h"#include "ui/CocosGUI.h"#include "cocostudio/CocoStudio.h"USING_NS_CC;USING_NS_CC_EXT;using namespace ui;
.cpp
auto background = LayerColor::create(Color4B(200,200,200,255)); addChild(background); auto s = Director::getInstance()->getWinSize(); auto spr_premulti = Sprite::create("fire.png"); spr_premulti->setPosition(Point(s.width/2-16, s.height/2+36)); auto spr_nonpremulti = Sprite::create("fire.png"); spr_nonpremulti->setPosition(Point(s.width/2-16, s.height/2-16));//// /* A2 & B2 setup */ //着色文理 create参数1、着色的宽 2、着色的高 3、颜色 auto rend = RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA8888); auto spr_size = spr_premulti->getContentSize(); rend->setKeepMatrix(true); Size pixelSize = Director::getInstance()->getWinSizeInPixels(); rend->setVirtualViewport(Point(0, 0), Rect(0, 0, s.width, s.height), Rect(0, 0, pixelSize.width, pixelSize.height)); // It's possible to modify the RenderTexture blending function by // [[rend sprite] setBlendFunc:(BlendFunc) {GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; rend->begin(); spr_premulti->visit(); spr_nonpremulti->visit(); rend->end(); rend->setPosition(Point(s.width / 2 + 56, s.height / 2)); addChild(spr_premulti); addChild(spr_nonpremulti); addChild(rend);
0 0
- cocos2d-x3.0 RenderTexture(二)
- Cocos2d-x3.0 RenderTexture(三)
- Cocos2d-x3.0 RenderTexture(一) 保存
- Cocos2d-x3.0 EventListener
- cocos2d-x3.0 SpriteFrameCache
- Cocos2d-x3.0触摸
- Cocos2d-x3.0 Button
- Cocos2d-x3.0 LoadingBar
- cocos2d-x3.0 PageView
- cocos2d-x3.0 RichText
- cocos2d-x3.0 ScrollView
- cocos2d-x3.0 Slider
- cocos2d-x3.0 ListView
- cocos2d-x3.0
- cocos2d-x3.0 柱图
- xcode5 cocos2d-x3.0 二 第一个项目(你好,亮哥)
- 【二】仿微信飞机大战cocos2d-x3.0rc1
- Cocos2d-x3.0RC2 Label 学习笔记二
- POJ3278 Catch That Cow(BFS入门)
- textblock 实现滚动条和自动换行
- 莱斯大学Python课程Mini-project#5 - Memory
- 黑马程序员_Java技术博客书写规范
- 大家来写2048 。。。控制台版
- cocos2d-x3.0 RenderTexture(二)
- windows下tomcat的安装与配置及eclipse的tomcat服务器搭建
- 【LeetCode】Linked list Cycle
- Android调用 Webservice报org.ksoap2.serializa 异常
- Struct2设置全局共享的action
- qsort和sort函数中的 cmp函数
- 数据库三级模式
- iOS学习笔记10(7)—GCD示例源码
- POJ 2528 Mayor's posters 线段树成段更新+离散化