随笔分类 -  cocos2d

cocos2d
摘要:只要在Eclipse上进行配置就行了,看图说话 阅读全文
posted @ 2015-05-19 10:33 痴人指路 阅读(616) 评论(0) 推荐(0) 编辑
摘要:有时候需要用代码的方式关闭程序,其实功能就像按了home键。这两种可以用 [self performSelector:@selector(notExistCall)]; abort(); 这两种是私有的,不能通过app store.[[UIApplication sharedApplication] performSelector:@selector(terminateWithSuccess)]; exit(0); 阅读全文
posted @ 2012-05-18 18:09 痴人指路 阅读(296) 评论(0) 推荐(0) 编辑
摘要:Bitmap Font ToolsBMFont (Windows)FonteditorGlyph DesignerHieroLabelAtlasCreatorParticle Editing ToolsParticleCreatorParticle DesignerPhysics Editing ToolsMekanimoPhysicsBenchPhysicsEditorVertexHelperScene Editing ToolsCocosBuilderCocoshopLevelHelperTexture Atlas ToolsDarkFunction EditorSpriteHelperT 阅读全文
posted @ 2012-04-09 13:07 痴人指路 阅读(145) 评论(0) 推荐(0) 编辑
摘要:实例说明[编辑] 线性贝塞尔曲线给定点P0、P1,线性贝塞尔曲线只是一条两点之间的直线。这条线由下式给出:且其等同于线性插值。[编辑] 二次方贝塞尔曲线二次方贝塞尔曲线的路径由给定点P0、P1、P2的函数B(t)追踪:。TrueType字型就运用了以贝塞尔样条组成的二次贝塞尔曲线。[编辑] 三次方贝塞尔曲线P0、P1、P2、P3四个点在平面或在三维空间中定义了三次方贝塞尔曲线。曲线起始于P0走向P1,并从P2的方向来到P3。一般不会经过P1或P2;这两个点只是在那里提供方向资讯。P0和P1之间的间距,决定了曲线在转而趋进P3之前,走向P2方向的“长度有多长”。曲线的参数形式为:。现代的成象系统 阅读全文
posted @ 2012-02-15 18:11 痴人指路 阅读(641) 评论(0) 推荐(2) 编辑
摘要:碰撞代码:if(CGRectContainsPoint(sprite.boundingBoy, touchLocation)){[self checkTheSprites:sprite]} 阅读全文
posted @ 2012-02-08 17:59 痴人指路 阅读(324) 评论(0) 推荐(0) 编辑
摘要://layer1 CCLayer *layer1 = [CCLayer node]; CGPoint p1 = layer1.anchorPoint; [layer1 setAnchorPoint:ccp(0,0)]; CCRenderTexture *renderer01 = [CCRenderTexture renderTextureWithWidth: layer1.contentSize.width height: layer1.contentSize.height]; [renderer01 begin];... 阅读全文
posted @ 2011-09-23 11:00 痴人指路 阅读(439) 评论(0) 推荐(0) 编辑
摘要:http://ityran.com/thread-27-1-1.html 来自于有时候为了方便需要是不是需要把UIImage转换成精灵 ,而有时候又需要把精灵转换成UIImage, 有木有为这些在烦恼的,有的话顶起来-(CCSprite *) convertImageToSprite:(UIImage *) image { CCTexture2D *texture = [[CCTexture2D alloc] initWithImage:image]; CCSprite *sprite = [CCSprite spriteWithTexture:texture]; [texture r... 阅读全文
posted @ 2011-09-21 10:15 痴人指路 阅读(1423) 评论(0) 推荐(0) 编辑
摘要:http://blog.csdn.net/windows_star/article/details/6010347cocos2d中,layer的主要任务就是接受用户的触摸,在看本文之前,读者最好了解ios与用户交互的方式,最好也知道cocos2d中是怎么相应用户的触摸到各个layer的。 首先我们继承自标准CCSprite,并且遵循CCTargetedTouchDeleget或者CCStandadTouchDeleget view plain////TestSprite.h//touchTest////Createdbyjeffreyon10-11-12.//Copyright2010__M. 阅读全文
posted @ 2011-08-24 15:19 痴人指路 阅读(418) 评论(0) 推荐(0) 编辑
摘要:源地址:http://www.cocoachina.com/blog/blog.php?do=showone&uid=4039&type=blog&cid=&itemid=927一、 HelloWorld开始之前,我假想你已经看过了HelloWorld的源代码,并看了用户手册中关于HelloWorld的相关说明,而且已经大致明白了大多数内容。其实HelloWorld已经用极其简单的语言向你描述了Box2D物理引擎的运作机制,我们可以归纳一下步骤:1、 建立一个世界,这个世界基于一个b2AABB框,并设立了一个g值和一个是否允许休眠的bool型变量。2、 建立一个 阅读全文
posted @ 2011-08-23 16:47 痴人指路 阅读(360) 评论(0) 推荐(0) 编辑
摘要:cocos2d中从场景切换到UIViewController视图- (void) showUIViewController:(UIViewController *) controller{ [[DirectorsharedDirector] pause]; [UIViewbeginAnimations:nil context:NULL]; [UIViewsetAnimationDuration:.5]; [UIViewsetAnimationTransition:UIViewAnimationTransitionCurlUpforView:[[Director sharedDirector]. 阅读全文
posted @ 2011-08-23 13:12 痴人指路 阅读(388) 评论(0) 推荐(0) 编辑
摘要:本文纯属转载,并为实验在游戏里做一个比较通用的提示框,这个提示框的背景是一个CCSprite。根据 提示框内容的多少,CCSprite可以自动缩放。问题是在UIView里UIImage是可以设置圆角保持的,但是在Cocos2D里怎么实现呢?根据 QuartzDemo官方例子,给出了解决方法。帖子地址 http://www.cocoachina.com/bbs/read.php?tid-17140.html代码 @interface StretchableSprite : CCSprite { } +(id)spriteWithFile:(NSString*)file size:(CGSize) 阅读全文
posted @ 2011-08-19 09:39 痴人指路 阅读(649) 评论(0) 推荐(0) 编辑
摘要:先推荐个专家博客:http://blog.csdn.net/dongfengsun/category/597201.aspxOpenGL ES游戏是这样写成的 http://cocoachina.com/bbs/read.php?tid-2687.html西蒙的教程中文版 http://www.cocoachina.com/bbs/read.php?tid-7086.htmlcocoaChina讨论区 http://www.cocoachina.com/bbs/thread.php?fid-18.htmlCocos2d中文版白皮书 http://bbs.weiphone.com/simple/ 阅读全文
posted @ 2011-08-07 14:50 痴人指路 阅读(480) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示