All Questions
Tagged with iphone cocos2d-iphone
2,903
questions
39
votes
4
answers
25k
views
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 ...
36
votes
7
answers
26k
views
Cocos2d for iPhone vs. Cocos2d-x [closed]
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 ...
27
votes
7
answers
41k
views
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, ...
26
votes
0
answers
2k
views
Texture coordinate Cocos3d [closed]
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 ...
25
votes
4
answers
30k
views
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:@"...
20
votes
8
answers
27k
views
How can I disable the touch detection?
How can I disable the touch detection within the action that running, because I don't want the character flying in the sky like a superman if the player clicking and clicking within the action, the ...
20
votes
3
answers
22k
views
Using custom fonts in Cocos2d
How do I use custom TTF fonts in my Cocos2d iPhone apps?
20
votes
3
answers
11k
views
Objective C - get the following day from today (tomorrow)
How can I check to see if a date is inherently TOMORROW?
I don't want to add hours or anything to a date like today, because if today is already 22:59, adding too much would go over to the day after, ...
20
votes
6
answers
29k
views
How can I create a count down timer for cocos2d?
I am developing a 2D iPhone game by using cocos2d. I need a countdown timer. How can I create a count down timer in cocos2d?
20
votes
4
answers
11k
views
Applying Zoom Effect In cocos2D gaming environment?
I'm working on a game with cocos2D game engine and make load all the sprites while it load the level, now as because some of sprites (obstacles) are taller than 320 pixel, thus it seems difficult to ...
19
votes
3
answers
45k
views
How to draw a line with Cocos2d-iPhone
I'm trying to get to grips with Cocos2d by trying to accomplish simple things. At this point, I have a scene, that scene has a background sprite, and a Layer. I'm trying to draw onto the Layer using ...
19
votes
1
answer
6k
views
How do you supress OpenGL messages in Xcode for iOS 12.0
I'm using an old version of Cocos2d-iphone and need to come up with one last release before I completely reconfigure my app for Metal support. Until then, I'm trying to work through all the ...
19
votes
1
answer
5k
views
Is it possible to achieve MAX(As,Ad) openGL blending?
I am working on a game where I want to create shadows under a series of sprites on a grid. The shadows are larger than the sprites themselves and the sprites are animated (i.e. move and rotate).
I ...
17
votes
1
answer
11k
views
cocos2d: playing a video in the background of a menu
I have a a CCLayer with the start menu of my app and I would like to have a short movie playing in the background.
I have succeded in playing a movie in the glView but when it plays the menu is not ...
16
votes
4
answers
26k
views
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?
16
votes
1
answer
5k
views
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 ...
16
votes
2
answers
5k
views
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 ...
16
votes
1
answer
13k
views
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) ...
15
votes
6
answers
20k
views
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?
14
votes
5
answers
13k
views
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 ...
13
votes
1
answer
8k
views
How to subscribe self on the event of Device Orientation(not interface orientation)?
in my app i want to call some method in CCScene myscene in the case of device rotation(orientation change).I disabled the autorotation(because i want it not to happen).
The issue is: i want to change ...
13
votes
2
answers
13k
views
How to implement HD "Retina Display" graphics in Cocos2D
I am not quite sure how use HD images for sprites in cocos2d. I looked through the documentation, and downloaded the newest beta which supports points instead of pixels, but I don't understand the ...
13
votes
1
answer
3k
views
Point in Tilt Direction - iPhone
In my cocos2d game, I have my player sprite and I want to have him move in the direction I tilt my iPhone. I can deal with that, the hardest bit which I can't work out is:
How do I make my sprite ...
12
votes
7
answers
9k
views
How to hide FPS numbers in bottom left of screen in Cocos2d
How do I get rid of the numbers in the bottom left of the screen when I am making a cocos2d game? This is probably a newb question, but still.
12
votes
7
answers
20k
views
Problem with cocos2D for iPhone and touch detection
I just don't get it.
I use cocos2d for development of a small game on the iPhone/Pod. The framework is just great, but I fail at touch detection. I read that you just need to overwrite the proper ...
12
votes
6
answers
4k
views
What mathematics is needed for a lunar lander game?
I'd like to build a game to learn cocos2d. Lunar lander is the first exercise coming in my mind. Any pointer/source code/tutorial of the physics calculations required will be appreciated. Thanks!
12
votes
1
answer
13k
views
Change the background image in cocos2d
I am making a game using cocos2d. in that I want to change the background after each second of time.
I don't know how to do this in cocos2d. I am having 15 different images and one by one each image ...
12
votes
2
answers
775
views
Multitouch not working in cocos2D for iPhone
I am quite familiar with cocos2D (been working with it for over 1 year) and I encountered a problem with my multitouch game - the multitouch.
What I have:
[glView setMultipleTouchEnabled:YES] in my ...
11
votes
7
answers
43k
views
How can I detect touch in cocos2d?
I am developing a 2d game for iPhone by using cocos2d.
I use many small sprite (image) in my game. I want to touch two similar types of sprite(image) and then both sprite(image) will be hidden.
...
11
votes
1
answer
3k
views
Moving a Stick figure, anchorpoints, animation, or something else...?
Ok so I am making a game with stick figures with cocos2d in objective c...
Different things need to be animated so please, give me a suggestion of what would be the best way to go about accomplishing ...
11
votes
1
answer
12k
views
How to stop the forces acting on a body in box2d
I am using box2d on the iphone to create a game. I have a body that is effected by gravity to move down and not right or left. It will get hit by another body and will then be moving right or left. I ...
11
votes
2
answers
6k
views
How to disable iPhone 6 native resolution?
I have several games made with Cocos2d-iphone. All of them are old projects created with Xcode 4 or 5. All games scale fine on the new iPhone 6 and 6 Plus except one that seems to avoid the scaling ...
11
votes
4
answers
4k
views
How to know when an user rates an iOS app/game
I am developing a game for iOS. I would like to implement a feature that allow the user rate my app and, if he does it, he will get points for my game.
I know how to display an screen, menu, whatever ...
11
votes
3
answers
10k
views
Best practices for handling touches to a CCSprite with cocos2d
Hey all. I just started looking into the cocos2d library. I've heard that it's an easy library to get into if you're used to programming in ActionScript and I've found that a lot of the concepts are ...
10
votes
4
answers
21k
views
Xcode : How To Set App To Be iPhone Only?
We have set the following app settings to be iPhone only, but in the App Store the app is listed as iPhone/iPad compatible.
As you can see in the following image, the device family is set to be just ...
10
votes
3
answers
6k
views
How to draw a background fast in cocos2d?
I'm toying with a small game on my iPad using cocos2d and I've run into some performance worries. I have a 512x512 image tiled as my background. That gives me around 40fps with 20 sprites (in a ...
10
votes
2
answers
3k
views
collision detection in cocos2d
i want to detect collision detection two times in same row.
for example:-(see the below image)
the ellipse and rectangle or detcted. after that my ellipse will travelling in the straight line path ...
9
votes
2
answers
1k
views
What are the "gotchas" when developing an iPhone Game? [closed]
Am used to developing business and reference apps. Now I have to do an iPhone game. What tips can you share to help me with:
understanding the scope of the project
defining the deliverables
...
9
votes
2
answers
15k
views
cocos2d-iOS - Gesture recognisers
Has anyone managed to get the gesture recognition working in cocos-2d?
I have read a post here that claimed to have achieved it, here: http://www.cocos2d-iphone.org/forum/topic/8929
I patched from ...
9
votes
4
answers
5k
views
Cocos2d Resources [closed]
Any recommendations on good sites/resources on programming with the Cocos2d-iPhone game engine?
What worked for you? What is the canonical place for all things Cocos2d? Any sites you recommend? Best ...
9
votes
2
answers
6k
views
Objective-C Category and new iVar
I try to extend the functionality of SimpleAudioEngine of cocos2d with the ability to play several sound effect one after another as some kind of chain. I tried to do this with an extension. However I ...
9
votes
2
answers
7k
views
Convert multiple .wav to .caf
I'm making an iPhone app and I have a ton of .wav files I need to convert to .caf
I can use this for each file:
afconvert -f caff -d LEI8@22050 walking.wav walking.caf
But that would take ages, so ...
9
votes
4
answers
8k
views
Cocos2D Rotation and Anchor point
The problem that I have is that when ever I change the anchor point sprite automatically rotates with respect to the current anchor point. And I don't want that to happen.
The steps that I followed
...
9
votes
2
answers
12k
views
Best way to display a game score on iPhone with cocos2d?
I am looking to persistently display a game score in an iPhone app using cocos2d. Going off the code that cocos2d shows the FPS the app is running at:
-(void) showFPS
{
frames++;
accumDt += ...
9
votes
1
answer
2k
views
How to check whether there is internet connection with the device: cocos-2d
In one of my iPhone app, I need to find out whether there is internet connection with the device or not. Anyone pls help?
9
votes
4
answers
8k
views
Multi-threaded OpenGL Programming in Cocos2D-iPhone
In an attempt to create a loading bar for an iPhone game I'm developing (using Cocos2D), I wanted to use a multithreaded approach.
One thread shows a loading screen and runs the main application ...
9
votes
1
answer
2k
views
RunWebThread taking up 33% of CPU time on iPhone App
I'm making a game for the iPhone using Cocos2D. At the beginning of the game, when there are few sprites, the game runs fine, but when there are many sprites on the screen, the game gets choppy.
I'...
8
votes
5
answers
10k
views
iOS app missing screenshot
Since iOS 6 came out and Apple is requiring screenshots for any apps you update, I'm having problems with app submission!
What if I DO NOT want to have my app support the iPhone 5's big screen yet?
...
8
votes
4
answers
6k
views
Cocos2d - animationwithframes:delay: deprecated
I would like to know what I should use in place of
animationWithFrames:delay:
and
actionWithAnimation:restoreOriginalFrame:
since they give a warning that they've been deprecated.
8
votes
4
answers
4k
views
iPhone:Learning Cocos2D project
I want to develop a game in a month by using the Cocos2D Open Source game engine. Learning Cocos2D is a bit hard and I don't know how to create my initial project by using the files provided by ...