ccrendertexture
int bgHeight=150;
CCSprite *sp=CCSprite::create("HelloWorld.png");
sp->setAnchorPoint(ccp(0,1));
sp->setPosition(ccp(0,bgHeight));
CCRenderTexture *render=CCRenderTexture::create(visibleSize.width,bgHeight);
render->begin();
sp->visit();
render->end();
render->setPosition(ccp(visibleSize.width/2,visibleSize.height/2));
addChild(render);
//or
CCSprite* label=CCSprite::create();
CCTexture2D *texture=new CCTexture2D();
texture->initWithImage(render->newCCImage());
label->initWithTexture(texture);
label->setAnchorPoint(ccp(0,0));
addChild(label);
ccrendertexture的更多相关文章
- ccrendertexture to uiimage
CCRenderTexture *renderTexture; [renderTexture getUIImage];
- 切取图片的一部分(利用CCRenderTexture)
转自:http://blog.csdn.net/wcjwdq/article/details/37932769 显示图片时,在项目中经常会用只读取图片的一部分,而不是全部. 错误方式:很多人这时候会采 ...
- 用CCRenderTexture和BlendFunc制作游戏教学时使用的黑色覆盖层
游戏快要完成了,准备做教学. 我们的教学是在整个界面上盖一层灰色图片,然后把提示点击的按钮部分亮出来,也就是在一块黑色图片上,按需求扣空一小部分.如图,把武器部分扣空,那么在其它地方又会扣空其它部分, ...
- cocos2d-x之蒙板,局部高亮可点,CCRenderTexture
转自:http://www.2cto.com/kf/201207/144656.html 蒙板,局部高亮可点的用处大多是在新手引导的时候,引导玩家一步一步的走游戏的操作流程. 之前写了一个cocos2 ...
- cocos2d/-x 用CCRenderTexture为一个CCLabelTTF创建阴影。
游戏UI中为了使字体更加漂亮,通常需要为字体添加一个阴影.其实不用美工,程序就可以添加.先为CCLabelTTF创建一个CCRenderTexture: CCRenderTexture* CCLabe ...
- CCRenderTexture画点出现十字架"歪解"
在泰然论坛发个了帖子,没有人解答,内容如下: 遇到奇葩问题了,cocos2dx 2.2 CCRenderTexture* tex=CCRenderTexture::create(, ); tex-&g ...
- [cocos2dx笔记013]一个使用CCRenderTexture创建动态纹理显示数字的类
用CCLabelTTF显示的数字不好看.于是就想到用图片来代理.眼下网上的实现都是把每一个数字做一个CCSprite组合的方式. 可是我想.动态生成纹理的方式.没有就仅仅好自己手动写一个. 头文件 # ...
- 用BlendFunc实现舞台灯光和刮刮卡效果
[转]http://code.lovemiao.com/?p=136#more-136 之前写过一篇<不规则形状按钮的点击判定>,利用了CCRenderTexture创建一块画布,可以在上 ...
- [cocos2d-js]cc.RenderTexture几种用法(数字图片、刮刮乐效果)
[转]http://blog.csdn.net/realcrazysun1/article/details/42393629 本文基于cocos2d-js 3.0版本引擎开发 RenderTextur ...
随机推荐
- IAR Embedded Workbench 破解方法+工具+授权文件
转自IAR Embedded Workbench 破解方法+工具+授权文件 本文重点阐述了如何手动爆破 IAR EWARM 6.x以及生成License,目的一是和大家分享下,二是自己记录下过程,以便 ...
- Spring+SpringMVC+Mybatis 利用AOP自定义注解实现可配置日志快照记录
http://my.oschina.net/ydsakyclguozi/blog/413822
- linux使用su切换用户提示 Authentication failure的解决方法& 复制文件时,报cp: omitting directory `XXX'
linux使用su切换用户提示 Authentication failure的解决方法:这个问题产生的原因是由于ubtun系统默认是没有激活root用户的,需要我们手工进行操作,在命令行界面下,或者在 ...
- 再探CRC
之前写了CRC16的程序,虽说能用,却不知其所心然,现在要用CRC32,重温一遍,一下就通了.笔记如下 CRC我没记错的话是Cyclic Redundancy Code,Cyclic和Redundan ...
- google python/c++ code style naming
python: Guidelines derived from Guido's Recommendations Type Public Internal Packages lower_with_und ...
- Java Entry使用
参考: http://blog.csdn.net/sunmenggmail/article/details/8952712 http://www.cnblogs.com/fstang/archive/ ...
- 【HDOJ】3726 Graph and Queries
Treap的基础题目,Treap是个挺不错的数据结构. /* */ #include <iostream> #include <string> #include <map ...
- Android Loader详解二:使用加载器
一个使用装载器的应用会典型的包含如下组件: 一个Activity或Fragment. 一个LoaderManager的实例. 一个加载被ContentProvider所支持的数据的CursorLoad ...
- Makefile第四讲:include 引用其它makefile文件
main.cpp #include "classes/fun.h" int main() { Test::display("Hello makefile"); ...
- (转载)Flash Number 数据类型
(转载)http://www.g168.net/txt/flash/learningactionscript/00001183.html Number 数据类型 Number 数据类型是双精度浮点数. ...