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
2 answers

iPhone: Camera following player in cocos2d

I'm making an iPhone game in cocos2d. I was wondering how I would make the camera / the view follow a specific sprite? would I use the CCCamera class?
Johannes Jensen
  • 1,228
  • 2
  • 18
  • 28
2
votes
1 answer

Rotating a cocos2d sprite on an anchor point outside of the sprite

Currently the setanchor function only sets the anchor within the sprite frame. Is there any (easier) wway to change the anchor point to a coordinate on screen space? My purpose is to allow the sprite to rotate around a circle. TIA for any…
Coke2Code
  • 177
  • 3
  • 12
2
votes
1 answer

raw_input() equivalent in cocos2d for Python

I'm building a simple game in cocos2d-0.6.0, and can't figure out how to let the player enter text for a username or other preferences. I've found only a few examples, like the one here, but it isn't quite what I'm looking for. My attempt is below;…
Nancy
  • 3,989
  • 5
  • 31
  • 49
2
votes
1 answer

How to play a BGM and know current playback time on in cocos2d ios?

I'm working on a IOS game based on music, and a strict synchronize between background music and global timer is necessary, so I'm looking for some way to play music AND at the same time knowing which exact position the music is playing on at each…
xxbidiao
  • 834
  • 5
  • 14
  • 27
2
votes
2 answers

How can I add Copperplate Gothic Bold font in my iPhone program?

I need to display some text in cocos2d layer. I added UITextView to it. I added the text in the text View. But, for setting the font by ( UIFont class), I could not do it. I saw the list of supported fonts for iPhone, In that list Copperplate…
srikanth rongali
  • 1,463
  • 4
  • 28
  • 53
2
votes
2 answers

small sprite touch

There are some games which have some small pictures as sprites and can move by touch.If the sprite is a larger picture,the touch is quite normal.And we can use the function CGRectContainsPoint check for the sprite.But when the sprite is quite…
new soul
  • 322
  • 1
  • 7
2
votes
0 answers

Multiple MPMoviePlayerViewController fullscreen movie init & switching issue - Fullscreen View doesn't autorotate and minor similar issues

This is my first post at SO. I would like to thank all of the SO users, their contribution have helped me a lot in all of my projects. I am new to the iPhone Application development scene. Aim of the project is to have a custom interactive User…
lal
  • 7,410
  • 7
  • 34
  • 45
2
votes
1 answer

How to stop the horizontal scrolling programmatically?

I have a UITextView *textView in cocos2d's CCLayer. The text is scrolling in both the horizontal and vertical directions. But, I need it to scroll and bounce only in vertically. How to stop the horizontal scrolling programmatically ? …
srikanth rongali
  • 1,463
  • 4
  • 28
  • 53
2
votes
0 answers

iOS8 crash with cocos2d and MKMapview

I am working on an app using cocos2d v3.3 and the Mapkit Framework. When I create a MapView, overlay it upon a scene, and do something like showing my position, everything works fine. But when I pop the scene (of course I also remove the mapview),…
Square
  • 21
  • 3
2
votes
3 answers

managing images in an iphone/ipad universal app

I'm just curious as to what methods people are using to dynamically use larger or smaller images in their universal iPhone/iPad apps. I created a large test image and I tried scaling down (using cocos2d) by 0.46875. After viewing that in the iPhone…
taber
  • 3,166
  • 4
  • 46
  • 72
2
votes
1 answer

cocos2D iphone v3.3 setBlendFunc deprecated

In v3.0 I used setBlendFunc. Now in 3.3 this method is warned as deprecated. What should be used instead ? Thanks.
lsmpascal
  • 762
  • 8
  • 24
2
votes
1 answer

Spritebuilder how can I change the animation ( CCB file ) of a CCNode programmatically?

I'm trying to make a Spritebuilder iPhone game, and my main character _player is a CCNode whose child is a CCBFile which holds the character's idle animation. I want to change this _player's CCBFile to another CCBFile called ForwardDash.ccbi which…
Waterfak
  • 54
  • 3
2
votes
2 answers

How could I skew/shear a sprite via SpriteKit like Cocos2D?

In Cocos2D-x, CCNode class provides "skewX" & "skewY" to let me do some distortion of the sprite, however, I fail to find similar mapping in SKNode of SpriteKit. My game uses Flash to port skeleton animations, in which the configs of positioning,…
2
votes
2 answers

Update Label Value in Cocos2d

I am making a game in cocos2d , In that while updating score the old score values get on the label and the new value get overwritten. I m using following code to display the score, LblScore = [CCLabel labelWithString:[NSString…
V.V
  • 3,082
  • 7
  • 49
  • 83
2
votes
3 answers

Xcode 3.2: Build & Analyze never finds any issues

I've used the Clang Static Analyzer from the command line before. I wanted to try Xcode's built-in version via Build & Analyze. I never get any negative results even though i specially prepared my code with very obvious issues Clang was always able…
CodeSmile
  • 64,284
  • 20
  • 132
  • 217