cocos2d
文章平均质量分 54
wakin002
这个作者很懒,什么都没留下…
展开
-
Porting Over iPad game to iphone the easy way cocos2d
//Add this code after "make the OpenGLView a child of the view controller" in the AppDelegate.m //This will shrink the content of the ipad to fit on the iphone smoothly. if (UI_USER_INTERFACE_ID转载 2013-01-25 15:39:12 · 412 阅读 · 0 评论 -
Actions
Actions are lightweight classes that are used on nodes to perform certain, well, actions. They allow you to move, rotate, scale, tint, fade, and do a lot of other things with a node. There are only原创 2013-01-20 15:24:14 · 437 阅读 · 0 评论 -
UIView + CCNode
1. CCNode + UIView - (OK) -(void) addSomeCocoaTouch { // regular text field with rounded corners UITextField* textField = [[UITextField alloc] initWithFrame: CGRectMake(40, 20, 200, 24)原创 2013-01-20 15:28:15 · 511 阅读 · 0 评论 -
Director, Scenes, and Layers
The Director [CCDirector sharedDirector] The CCDirector class stores global configuration settings for cocos2d and also manages the cocos2d scenes. The major responsibilities o原创 2013-01-20 15:20:23 · 798 阅读 · 0 评论 -
Subclassing CCParticleSystem: Point or Quad?
Point particles are a bit faster on first- and second-generation iOS devices but don’t perform well on third- and fourth-generation devices like the iPhone 3GS, iPad, and iPhone 4. This is because o原创 2013-01-20 15:24:58 · 337 阅读 · 0 评论 -
Cocos2d坐标系统
Cocos2d 中texture在opengl中的存储顺序: (与textureRect.origion相同,与opengl uv坐标正好相反) 左上点是(0, 0) 右上点是(1, 0) 左下点是(0, 1) 右下点是(1, 1) 在opengl中的存储顺序是:(0, 0), (0, 1), (1, 0), (1, 1) cocos2d中texture在屏幕上的坐标系统: s原创 2013-01-28 10:16:44 · 787 阅读 · 0 评论 -
glBlendFunc
Let's say you have already rendered a blue quad, and right now you're rendering a red quad on top of it, with blending on. For each pixel rendered, there are 2 values: the color which is currently s转载 2013-01-28 10:14:56 · 660 阅读 · 0 评论 -
Cocos2d坐标系统
Cocos2d中texture在opengl中的存储顺序: (与textureRect.origion相同,与opengl uv坐标正好相反) 左上点是(0, 0) 右上点是(1, 0) 左下点是(0, 1) 右下点是(1, 1) 在opengl中的存储顺序是:(0, 0), (0, 1), (1, 0), (1, 1) cocos2d中texture在屏幕上的坐标系统: spri原创 2013-01-25 15:54:56 · 384 阅读 · 0 评论 -
cocos2d 中添加显示文字的三种方式
在cocos2d 中有三个类可以在层或精灵中添加文字: CCLabelTTF CCLabelBMFont CCLabelAtlas CCLabelTTF CCLabelTTF 每次调用 setString (即改变文字)的时候,一个新的OPENGL 纹理将会被创建.。这意味着setString 和创建一个新的标签一样慢。 所以,当你转载 2013-01-25 15:44:46 · 994 阅读 · 0 评论 -
About contentSize, contentSizeInpixel and textureRect
texture.contentSize: texture在不同分辨率下共同的size,都是在480x320下的尺寸大小 texture.contentSizeInpixel: texture的实际尺寸 contentSize和textureRect sprite.contentSize: sprite的size大小 sprite.textureRect: 如果是frame atla原创 2013-01-25 15:40:31 · 431 阅读 · 0 评论 -
Array Performance Comparison: C-Array vs CCArray vs NSArray vs NSMutableArray
On September 13, 2010, in cocos2d, Programming, by Steffen Itterheim When TechnoKinetics mentioned on Twitter he was annoyed with cocos2d, I wanted to know why. It turns out it was the change a转载 2013-01-25 15:56:29 · 536 阅读 · 0 评论 -
Using the Texture Atlas with cocos2d
To use pvr images, you need// Enable pre multiplied alpha for PVR textures to avoid artifacts [CCTexture2D PVRImagesHavePremultipliedAlpha:YES]; How to use pvr images and plist: // Load the textu原创 2013-01-25 15:52:22 · 513 阅读 · 0 评论 -
UIView + CCNode
1. CCNode + UIView - (OK) -(void) addSomeCocoaTouch { // regular text field with rounded corners UITextField* textField = [[UITextField alloc] initWithFrame: CGRectMake(40, 20, 200, 24原创 2013-01-26 15:42:28 · 489 阅读 · 0 评论 -
Timers VS Scheduler
Try NOT to use Cocoa’s NSTimer. Instead use cocos2d’s own scheduler. If you use cocos2d scheduler, you will have: automatic pause/resume. when the CCLayer (CCScene, CCSprite, CCNode) ente转载 2013-01-26 15:28:03 · 327 阅读 · 0 评论 -
Why Schduler function is not called?
The reason it didn't work for me is that I didn't add the object to the scene layer. Apparently if it's not part of a scene, it is automatically set to paused. As for you, this should be just fine,原创 2013-01-25 15:41:23 · 469 阅读 · 0 评论 -
Anchor Point
On default, CCNode’s anchor point is (0, 0), which is at the left-bottom point. CCSprite’s anchor point is (0.5, 0.5), which is at the center. 如果你把一个CCSprite作为child加入到CCNode中,CCNode的anchor point不会对s原创 2013-01-25 15:37:55 · 608 阅读 · 0 评论