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
2
votes
1 answer

Multiple parameters in method issue

My first shot at creating a method with multiple parameters. Still trying to wrap my head around how Objective C does things. Been banging my head for a couple days on this now. Finally ready to ask for help. Searched and tried many posts here on…
J C
  • 63
  • 1
  • 7
2
votes
2 answers

Physics game with cocos2d for iphone v3.0.0

I'm new to cocos2d-iphone, I'm creating demo app about physics with cocos2d-iphone I want to create an outline of the basic physics node (node #1), to keep some node "in door" And I add some node (nodes #2) into node #1 But when I rotate node #1,…
Tony
  • 4,311
  • 26
  • 49
2
votes
1 answer

Change OpenGL ES version on iOS

My OpenGL calls are behaving a bit strange on iPhone 5S and iPad Air. I don't know why, but maybe it is due to the fact that they support OpenGL ES 3, whereas previous devices do not. So I guess it is using OpenGL ES 3 and that may be the problem. I…
Saturn
  • 17,888
  • 49
  • 145
  • 271
2
votes
1 answer

Rotate actions don't work in iPhone 5S and iPad Air, for cocos2d-iphone 1.0.1

Using cocos2d-1.0.1 Have [sprite runAction:[CCRotateBy actionWithDuration:10.0 angle:360]]; Your sprite rotates all nicely. Works fine on all devices and iOS versions. ... except iPhone 5S and iPad Air. If you do the above code, the rotation is…
Saturn
  • 17,888
  • 49
  • 145
  • 271
2
votes
1 answer

Endless Horizontal Scrolling in Cocos2d

How to create an infinite background in cocos2d without block Gap.I am building an app with a ball moving from left to right, and I want it to move infinitely. Well in that case I would have an endless background so the ball could keep moving.I got…
Stalin Pusparaj
  • 741
  • 9
  • 11
2
votes
0 answers

Using SVG files with cocos2d v3.x

I am trying to use SVG files for graphics with cocos2d v3.x, Found this link but Its not working with the latest version. Anybody knows how can I use SVG with the latest version of cocos2d.
Haroon
  • 697
  • 1
  • 9
  • 24
2
votes
2 answers

Cocos2d v3 CCButton with label using CCLabelBMFont

I am trying to create a CCButton named "Start" in cocos2d v3 using CCLableBMFont label as the button image. But I can't seem to get the label to be in the CCButton in v3. Any help/advice would be appreciated.
xSk
  • 25
  • 5
2
votes
1 answer

Place a sprite at the bottom of the screen independently from resolution

I need to place a sprite at the bottom of the screen independently from resolution using cocos2d for iPhone, so that if a sprite is at the bottom on iPhone 5/5s, it will be at the bottom even on iPhone 4/4s. The following code works on iPhone5/5s…
luaLover
  • 141
  • 1
  • 11
2
votes
3 answers

take snapshot of an ios cocos2d app

Is there an efficient way to do this? currently i use [renderTexture begin]; [self.view visit]; [renderTexture end]; but app jitters because of it. I read I can copy contents of frame buffer for this. Is that true? Can someone guide me how to do…
anuj
  • 1,010
  • 2
  • 11
  • 26
2
votes
3 answers

What does userInteractionEnabled = NO mean and how does it work?

Cocos 2d-iphone 3.0. I am using this code to detect whether a single sprite is touched -(void) touchBegan:(UITouch *)touch withEvent:(UIEvent *)event { CGPoint location = [touch locationInView: [touch view]]; CGPoint convertedlocation =…
user3475724
2
votes
1 answer

Detecting if a sprite was touched on child scene Cocos2d

I have a scene with buttons and node Level in which I load another scene (layer created with Sprite Builder): -(void) didLoadFromCCB { //the Gameplay Scene loaded // tell this scene to accept touches self.userInteractionEnabled = TRUE; …
2
votes
1 answer

Cocos2d iPhone v3.0 - Swiping up to perform an action

I am having some problems with setting up touches to swipe up to perform an actions. I am trying to use the code below, but it will not recognize the touches. -(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSSet *allTouches =…
C__ESP
  • 57
  • 4
2
votes
0 answers

cocos2d v3 force orientation change within a scene

I am looking for a way to change IOS device orientation when a scene loads. There are some questions asked in this direction but no concrete answers for v3. I have 3 scenes, one should be in portrait while other 2 in landscape mode after a button…
ganesh
  • 166
  • 3
  • 10
2
votes
1 answer

Error -60005 when install Cocos2d-iPhone v3 RC4

When I try to install Cocos2d-iphone 3.0.0 RC4, I got an error: (run without sudo) Error -60005 occurred while executing script with privileges. So, I try to show its package content and use terminal to do: cd ...Cocos2D Installer…
Tony
  • 4,311
  • 26
  • 49
2
votes
0 answers

Cocos2d V3 issue with texture parameters

I've been following a tutorial for creating textures using cocos2d v2 but I am now using v3 (I have just started learning). I ran into a few issues where v2 code doesn't work in v3 but I managed to get round them. I'm now stuck with just one…
Designer023
  • 1,902
  • 1
  • 26
  • 43