Questions tagged [cocos2d-iphone]

Objective-C version for iOS & OS X of Cocos2d. Cocos2d is a framework for building 2D games and graphical applications.

Cocos2D for iPhone is an framework for building 2D games and graphical applications for iOS devices and Mac OS X computers. Cocos2D for iPhone was ported from the Cocos2D Python-based framework.

"Cocos2D for iPhone" (project name: cocos2d-iphone) is a free and open source project published under an MIT License.

"Cocos2D" (project name: cocos2d) is the "grandfather" of all Cocos2D game engines. Cocos2D is written in Python and allows developers to create games and applications for Windows, Linux and Mac OS X. Cocos2D is published under a BSD License.

There are a number of other Cocos2D based game engines, the most actively updated and most widely used are:

ShinyCocos (Ruby), CocosNet (C#) and Cocos2D for Windows (C++) haven't been updated in a long time, these Cocos2D versions are considered defunct. Cocos3D is a 3D extension to Cocos2D. See the Cocos2D Game Engines list for a complete overview.

The immense popularity of Cocos2D for iPhone has the effect that most developers use the term "Cocos2D" when referring to the Cocos2D for iPhone framework.

It is recommended to use the following tags appropriately:

  • Use the tag on questions referring to the Python based framework
  • Use the tag on questions referring to the Objective-C based framework
  • Use the tag on questions referring to the C++ based cross-platform framework
  • Use the tag on questions referring to the JavaScript based framework
  • Use the tag on questions referring to the C#-MonoGame Framework.
  • Use the tag on questions referring to the Java based frameworks
  • Don't use any of the above tags together in the same question, unless your question refers to more than one Cocos2D engine. For example, if you ask "How to port from cocos2d-iphone to cocos2d-x?" you should include both and tags.

Books:

10198 questions
16
votes
2 answers

Building a simple bridge between objc and lua?

I have integrated Lua with my ObjC code (iphone game). The setup was pretty easy, but now, I have a little problem with the bridging. I have googled for results, etc... and it seems there isn't anything that could work without modifications. I mean,…
Notbad
  • 5,936
  • 12
  • 54
  • 100
16
votes
1 answer

where to start for game development? UIKit vs Core Animation vs QuartzCore vs OpenGL vs cocos2D

If I was interested in getting across game development on the iPhone/iPAD any suggestions on which technology(s) to start looking into? In fact just a simple bullet on each of these technologies that highlight how it fits into typical game…
Greg
  • 34,042
  • 79
  • 253
  • 454
16
votes
1 answer

Create layer mask with custom-shaped hole

I've spent too much time trying to figure this out and simply cannot find a workable solution. Situation: 1. A picture of 'something' is displayed on the phone. 2. A semi-transparent (e.g. blue) layer is placed on top of the image, completely…
GtotheB
  • 2,727
  • 4
  • 21
  • 17
16
votes
4 answers

how can I use animation in cocos2d?

I am trying to develop a Roulette game for iPhone. How can I animation (spin) the Roulette board?
Md Nasir Uddin
  • 2,130
  • 8
  • 38
  • 59
16
votes
4 answers

Cocos2d 2.0 - Ignoring touches to transparent areas of layers/sprites

I have an app where I have several layers created from PNG images with transparency. These layers are all on the screen over each other. I need to be able to ignore touches given to transparent areas of layers and just be able to detect as touches,…
Duck
  • 34,902
  • 47
  • 248
  • 470
15
votes
1 answer

Box2d multiple fixtures and positioning

I'm attempting to create a "U" shape in Box2d (in Cocos2d) by joining 3 rectangles like so: |_| It sounds like joints are not the correct solution here since I don't want any movement so I have created a main body which is the middle bit and 2…
GivP
  • 2,634
  • 6
  • 32
  • 34
15
votes
1 answer

iOS. Cannot run a project after updating cocos2d library inside this project

It cannot compile sources and writes: Undefined symbols for architecture i386: "_CTFontManagerRegisterFontsForURL", referenced from: -[CCLabelTTF getFontName:] in CCLabelTTF.o ld: symbol(s) not found for architecture i386 clang: error:…
Gargo
  • 1,135
  • 1
  • 10
  • 21
15
votes
1 answer

Cannot find protocol declaration for CCTargetTouchDelegate/CCStandardTouchDelegate

I have upgraded my project to the latest beta of cocos2d 2.1 and I am now receiving the errors, Cannot find protocol declaration for CCTargetTouchDelegate and Cannot find protocol declaration for CCStandardTouchDelegate How do I fix this?
Ben Trengrove
  • 8,191
  • 3
  • 40
  • 58
15
votes
4 answers

How to set background color of layer in cocos2d-x?

I've been writing a game using cocos2d-x and ran into an issue with changing the background color. I found an example in cocos2d, but apparently this only applies to cocos2d which is written in Obj-c. Basically the idea is to use a CCLayerColor…
Edward
  • 7,346
  • 8
  • 62
  • 123
15
votes
6 answers

How to draw a solid circle with cocos2d for iPhone

Is it possible to draw a filled circle with cocos2d ? An outlined circle can be done using the drawCircle() function, but is there a way to fill it in a certain color? Perhaps by using pure OpenGL?
Reinout Roels
14
votes
2 answers

OpenGL vs Cocos2d: What to choose?

I understand that cocos2d it's really simple API, and that I can use it to do simple and huge 2D or even sometimes 3D games/applications. As well I understand that OpenGL it's more complicated, it's lower level API etc. Question: What is better for…
Anatoliy Gatt
  • 2,501
  • 3
  • 26
  • 42
14
votes
5 answers

Command /usr/sbin/chown failed with exit code 1?

Each time I try to archive my application to submit it to apple Xcode keeps giving me this error! I'v Triple checked that in the Cocos2d libraries Target i made that my Install Group & Install Owner are correct and i;v restarted my computer &…
Alex Crawford
  • 321
  • 1
  • 4
  • 16
14
votes
3 answers

Cocos2d iPhone - Sprite cliping/mask/frame

how can i clip/crop/mask or just set the frame of a CCSprite in Cocos2D? Something similar to: setting the frame for UIView, with clipping subviews = TRUE My CCSprite Main Sprite have multiple Child Sprite added to it. I only want Mask part of that…
Bach
  • 2,684
  • 5
  • 26
  • 36
14
votes
2 answers

cannot init a class object : objective-C

I'm trying to make a simple subclass of CCNode, but I can't create the object. It gives me the error "* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* +[ContentPane<0x206898> init]: cannot init a class…
Aeisys
  • 367
  • 1
  • 3
  • 13
14
votes
5 answers

How can I include cocos2d-x templates in Xcode?

I'm trying to follow this guide which is often quoted as being an excellent tutorial for Cocos2d-x. The problem is that my downloads for Cocos2d-x (2.2 and 3.0 alpha0) do not include the file the tutorial indicates, install-templates-xcode.sh. Any…
D'Arcy Rail-Ip
  • 11,505
  • 11
  • 42
  • 67