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
57
votes
4 answers

How to get UITouch location from UIGestureRecognizer

I want to get the UITouch location of my tap from UIGestureRecognizer, but I can not figure out how to from looking at both the documentation and other SO questions. Can one of you guide me? - (void)handleTap:(UITapGestureRecognizer…
Oscar Apeland
  • 6,422
  • 7
  • 44
  • 92
56
votes
7 answers

Choose a destination with a supported architecture in order to run on this device

my Xcode is Version 4.4.1 The project worked perfect before updating to this newer version, but now it stopped working
user1297301
  • 887
  • 1
  • 9
  • 12
44
votes
18 answers

duplicate symbol _OBJC_METACLASS_$_ClassName

I am trying to run my cocos2d application and facing this error, as I have recently upgraded my sdk to 4.2 and my cocos2d to 0.99.5. I tried to clean my project even change the Target ios Deployment but error remains the same. Also rename the…
user366584
  • 1,016
  • 1
  • 16
  • 34
38
votes
4 answers

how to get Distance of Object from iPhone camera using image Exif meta data?

Edit: Sorry for late Edit, Without two parameter you cannot calculate it, So first need to fill user Camera height from ground. I have check a number of solutions but none of them helpful! I know that Working Distance = (Sensor Height + Subject…
9to5ios
  • 5,319
  • 2
  • 37
  • 65
37
votes
20 answers

Admob bannerView Request Error: No ad to show

I'm having this issue on one of my ads for an ios game Here is my code, the odd thing is that if I add the device on the request.testDevices list it displays the demo banner, if I remove from testDevices, it does not show a real banner, but if I…
Gil Beyruth
  • 598
  • 1
  • 6
  • 11
36
votes
7 answers

Cocos2d for iPhone vs. Cocos2d-x

I have worked some with Cocos2d for iPhone and find it delightful. I am starting another project, and have stumbled across Cocos2d-x, a C++ port. I'm tempted by the notion of being able to (with consideration) build for multiple platforms at once.…
WiseOldDuck
  • 3,156
  • 2
  • 24
  • 27
33
votes
11 answers

Changing the image of a CCSprite

I have created a number of CCSprites using spriteWithFile. How do I change the image for the sprite during runtime? I need to change a few sprites images quite regularly.
user773578
  • 1,161
  • 2
  • 13
  • 24
27
votes
7 answers

Detect when UIGestureRecognizer is up, down, left and right Cocos2d

I have a CCSprite that I want to move around using gestures. Problem is I'm completely new to Cocos2D. I want my sprite to perform one action when the gesture is up, another one when gesture is down, another action when gesture is right and same…
Magnus
  • 1,444
  • 5
  • 22
  • 31
26
votes
0 answers

Texture coordinate Cocos3d

Here is how I put my texture on my object : _obj = (CC3MeshNode *)[_world getNodeNamed:@"s0"]; _obj.material.texture = [CC3Texture textureFromFile:@"objTextureLayout.png"]; My object is loaded from 3DMAX and I don't understand why my texture…
klefevre
  • 8,595
  • 7
  • 42
  • 71
26
votes
6 answers

UIActivityViewControllerCompletionHandler How to?

I am trying to use the UIActivityViewControllerCompletionHandler , but i dont quite get how.. I want to detect when the user finishes or dismisses this view controller (UIActivityViewController). Anyone knows how?
Emre Akman
  • 1,212
  • 3
  • 19
  • 25
25
votes
4 answers

Cocos2d adding a background image to a layer?

I just finished reading some of the cocos2d documentation, and as far as I understand to add a background image to a layer you have to do something like: Sprite * bg = [Sprite spriteWithFile:@"Background.png"]; [layer addChild:bg z:0]; Allthough as…
Oscar Gomez
  • 18,436
  • 13
  • 85
  • 118
23
votes
4 answers

Should I subclass CCSprite, CCNode, or NSObject?

I see that certain texts always seem to subclass CCSprite. I read somewhere that it is not good to do that and that it is better to start with something basic. I wanted to find out what the pro game developers do in terms of game structure. That is…
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169
22
votes
7 answers

Get angle from 2 positions

I have 2 objects and when I move one, I want to get the angle from the other. For example: Object1X = 211.000000, Object1Y = 429.000000 Object2X = 246.500000, Object2Y = 441.500000 I have tried the following and every variation under the…
21
votes
4 answers

Coco2d 2.1 and Xcode 7 iOS 9 crash ccShader

I tested Xcode 7 with but my cocos2d 2.1 games crash on simulator or on devices: ccShader_PositionColorLenghtTexture_frag.h 2015-06-15 22:36:13.319 NanoWar[18789:456971] cocos2d: ERROR: 0:12: '' : syntax error: #extension must always be before any…
Benoît Freslon
  • 2,021
  • 4
  • 26
  • 35
21
votes
2 answers

Unity vs Libgdx vs Cocos2d-x

I'm a Android and a Software Programmer. Currently I know three languages C++, C#, Java. Now I want to make games as well. After searching the Internet I got the names of these three engine, so which engine should I use for game development for…
Bhavya Maroo
  • 237
  • 1
  • 2
  • 7
1
2 3
99 100