xak的专栏

Sometimes when I look at the world, I can see a line behind it.

cocos2d-x sprite setcolor 无效

原因:CCSPrite的color不是纯覆盖,而是混合,就是在原有颜色的基础上添加颜色,而原来的颜色是黑色,不管设置什么颜色,叠加之后还是黑色。 解决方法:原始图片设置成白色。

2014-08-22 11:52:49

阅读数:2323

评论数:0

How To Use Box2D For Just Collision Detection with cocos2d-iphone

原文地址:http://www.raywenderlich.com/606/box2d-tutorial-for-ios-how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone

2014-08-22 11:52:36

阅读数:1042

评论数:0

COCOS2D-X屏幕适配

原文地址:http://www.cocos2d-x.org/wiki/Multi_resolution_support Multi-resolution support The APIs used in this document are available since cocos2d-2....

2014-08-22 11:52:25

阅读数:1084

评论数:0

Let Schedule never get Paused[Cocos2d]

CCLayer *layer = [CCLayer node];  CCLabelTTF *label = [CCLabelTTF labelWithString:@"Test" fontName:@"Marker Felt" fontSize:32]...

2014-08-22 11:52:06

阅读数:400

评论数:0

CCSPRITE:Load image from users documents folder

You can actually use +(id)spriteWithFile:(NSString*)filename; as normal, you only have to supply the absolute filepath like: NSArray *paths = NSSea...

2014-08-22 11:51:48

阅读数:493

评论数:0

CCLabelTTF with fixed width and dynamic height solution

CGSize size = [[CCDirector sharedDirector] winSize]; NSString *str = [NSString stringWithString:@" did a bit of research and was able to find o...

2014-08-22 11:51:29

阅读数:629

评论数:0

COCOS2D屏幕的调试信息

其中第一行是绘画的内容数量,和精灵个数有关 第二行是“秒每帧”:SPF = Seconds PerFrame 第三行是"帧每秒/帧速率":FPS = Frames PerSecond // Display FSP and SPF [director_ setD...

2014-08-22 11:50:37

阅读数:542

评论数:0

计算触摸平均速度效果比较好的方式

float lambda = 0.8f; // the closer to 1 the higher weight to the next touch   newSpeed = (1.0 - lambda) * oldSpeed + lambda* (distanceFromPrevious...

2014-08-22 11:50:33

阅读数:649

评论数:0

Cocos2d 2.0后CCProgressTimer变化

Before cocos2d 2.0, you should be able to just use CCProgressTimer of type:kCCProgressTimerTypeHorizontalBarLR. CCProgressTimer* powerBar= [CCProgr...

2014-08-22 11:50:28

阅读数:474

评论数:0

cocos2d disable touches to all other views

just add a invisable layer which swallow touches. 注:When you register CCTouchDispatcher you have to use lower priority than your containing layer if ...

2014-08-22 11:50:13

阅读数:387

评论数:0

cocos2d屏幕部分区域无法响应触摸事件

原因:前一个场景有使用menu。导致menu所在的区域无法响应touch事件。 最简单的方法,在前一个场景exit的时候移除menu。(建议在每一个场景onexit的时候,手动移除所有的children。

2014-08-22 11:50:07

阅读数:587

评论数:0

CCOrbitCamera 使用

1.水平翻转: [CCOrbitCamera actionWithDuration:2 radius:1 deltaRadius:0 angleZ:0 deltaAngleZ:360 angleX:0 deltaAngleX:0] 2、垂直翻转: [CCOrbit...

2014-08-22 11:49:45

阅读数:603

评论数:0

Cocos2d 文本输入框 TextField

Cocos2d 文本输入框 TextField 发表回复 https://github.com/iNinja/CCTextField Integrating cocos2d and UIKitLayer http://stackoverflow.com/questions/1128...

2014-08-22 11:49:04

阅读数:1982

评论数:0

convertToWorldSpace无效

原因:只能是sprite的父节点来调用convertToWorldSpace Sprite A-->SpriteB if you want know the position of your spriteB in the current world you must call the &...

2014-08-22 11:48:35

阅读数:519

评论数:0

CCOrbitCamera-cocos2d翻转效果

cocos2d翻转效果" />   参数分别为旋转的时间,起始半径,半径差,起始z角,旋转z角差,起始x角,旋转x角差 使用举例: -(void) flipCard1 {     [cardBack1 runAction:[CCSequence actions...

2014-08-22 11:48:12

阅读数:697

评论数:0

Cocos2d touch监听顺序

在Cocos2d中,默认会按照注册时候的权重(priority)分发给所有的监听对象,直到有对象消费为止(swallowsTouche为true)。也就是说,不管touch事件是否发生在该对象(如sprite)的区域(bound)内,只要该sprite有注册过touch监听,就可以监听到touch...

2014-08-22 11:48:09

阅读数:449

评论数:0

CCSpriteBatchNode使用限制

CCSpriteBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call (often known as "batch draw"). ...

2014-08-22 11:47:57

阅读数:489

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭